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