Two copy modes are exclusive

This commit is contained in:
Arun Prakash Jana 2018-04-17 02:22:23 +05:30
parent f652a4fecb
commit ebb4725204
No known key found for this signature in database
GPG Key ID: A75979F35C080412
1 changed files with 42 additions and 44 deletions

18
nnn.c
View File

@ -305,7 +305,7 @@ static const char messages[][16] =
"HOME not set", "HOME not set",
"no traversal", "no traversal",
"invalid key", "invalid key",
"set NNN_COPIER", "set copy method",
"%F %T %z", "%F %T %z",
}; };
@ -2980,7 +2980,9 @@ nochange:
copycurname(); copycurname();
goto begin; goto begin;
case SEL_COPY: case SEL_COPY:
if (copier && ndents) { if (!(cfg.noxdisplay || copier))
printmsg(messages[STR_COPY_ID]);
else if (ndents) {
if (cfg.copymode) { if (cfg.copymode) {
r = mkpath(path, dents[cur].name, newpath, PATH_MAX); r = mkpath(path, dents[cur].name, newpath, PATH_MAX);
if (!appendfilepath(newpath, r)) if (!appendfilepath(newpath, r))
@ -3007,17 +3009,12 @@ nochange:
spawn(copier, newpath, NULL, NULL, F_NOTRACE); spawn(copier, newpath, NULL, NULL, F_NOTRACE);
printmsg(newpath); printmsg(newpath);
} }
} else if (!copier) }
printmsg(messages[STR_COPY_ID]);
goto nochange; goto nochange;
case SEL_COPYMUL: case SEL_COPYMUL:
if (!copier) { if (!(cfg.noxdisplay || copier))
printmsg(messages[STR_COPY_ID]); printmsg(messages[STR_COPY_ID]);
goto nochange; else if (ndents) {
} else if (!ndents) {
goto nochange;
}
cfg.copymode ^= 1; cfg.copymode ^= 1;
if (cfg.copymode) { if (cfg.copymode) {
g_crc = crc8fast((uchar *)dents, ndents * sizeof(struct entry)); g_crc = crc8fast((uchar *)dents, ndents * sizeof(struct entry));
@ -3060,6 +3057,7 @@ nochange:
} else } else
printmsg("multi-copy off"); printmsg("multi-copy off");
} }
}
goto nochange; goto nochange;
case SEL_QUOTE: case SEL_QUOTE:
cfg.quote ^= 1; cfg.quote ^= 1;