Prefer selection to copy in names

This commit is contained in:
Arun Prakash Jana 2019-09-08 14:23:00 +05:30
parent 9988d254fe
commit 84119b1238
No known key found for this signature in database
GPG Key ID: A75979F35C080412
2 changed files with 91 additions and 91 deletions

172
src/nnn.c
View File

@ -140,7 +140,7 @@
/* Entry flags */ /* Entry flags */
#define DIR_OR_LINK_TO_DIR 0x1 #define DIR_OR_LINK_TO_DIR 0x1
#define FILE_COPIED 0x10 #define FILE_SELECTED 0x10
/* Macros to define process spawn behaviour as flags */ /* Macros to define process spawn behaviour as flags */
#define F_NONE 0x00 /* no flag set */ #define F_NONE 0x00 /* no flag set */
@ -213,7 +213,7 @@ typedef struct {
uint blkorder : 1; /* Set to sort by blocks used (disk usage) */ uint blkorder : 1; /* Set to sort by blocks used (disk usage) */
uint extnorder : 1; /* Order by extension */ uint extnorder : 1; /* Order by extension */
uint showhidden : 1; /* Set to show hidden files */ uint showhidden : 1; /* Set to show hidden files */
uint copymode : 1; /* Set when copying files */ uint selmode : 1; /* Set when selecting files */
uint showdetail : 1; /* Clear to show fewer file info */ uint showdetail : 1; /* Clear to show fewer file info */
uint ctxactive : 1; /* Context active or not */ uint ctxactive : 1; /* Context active or not */
uint reserved : 7; uint reserved : 7;
@ -254,7 +254,7 @@ static settings cfg = {
0, /* blkorder */ 0, /* blkorder */
0, /* extnorder */ 0, /* extnorder */
0, /* showhidden */ 0, /* showhidden */
0, /* copymode */ 0, /* selmode */
0, /* showdetail */ 0, /* showdetail */
1, /* ctxactive */ 1, /* ctxactive */
0, /* reserved */ 0, /* reserved */
@ -279,7 +279,7 @@ static int ndents, cur, curscroll, total_dents = ENTRY_INCR;
static int xlines, xcols; static int xlines, xcols;
static int nselected; static int nselected;
static uint idle; static uint idle;
static uint idletimeout, copybufpos, copybuflen; static uint idletimeout, selbufpos, selbuflen;
static char *bmstr; static char *bmstr;
static char *pluginstr; static char *pluginstr;
static char *opener; static char *opener;
@ -292,7 +292,7 @@ static char *initpath;
static char *cfgdir; static char *cfgdir;
static char *g_cppath; static char *g_cppath;
static char *plugindir; static char *plugindir;
static char *pnamebuf, *pcopybuf; static char *pnamebuf, *pselbuf;
static struct entry *dents; static struct entry *dents;
static blkcnt_t ent_blocks; static blkcnt_t ent_blocks;
static blkcnt_t dir_blocks; static blkcnt_t dir_blocks;
@ -576,7 +576,7 @@ static void printerr(int linenum)
perror(xitoa(linenum)); perror(xitoa(linenum));
if (!cfg.picker && g_cppath) if (!cfg.picker && g_cppath)
unlink(g_cppath); unlink(g_cppath);
free(pcopybuf); free(pselbuf);
exit(1); exit(1);
} }
@ -793,31 +793,31 @@ static void writecp(const char *buf, const size_t buflen)
static void appendfpath(const char *path, const size_t len) static void appendfpath(const char *path, const size_t len)
{ {
if ((copybufpos >= copybuflen) || ((len + 3) > (copybuflen - copybufpos))) { if ((selbufpos >= selbuflen) || ((len + 3) > (selbuflen - selbufpos))) {
copybuflen += PATH_MAX; selbuflen += PATH_MAX;
pcopybuf = xrealloc(pcopybuf, copybuflen); pselbuf = xrealloc(pselbuf, selbuflen);
if (!pcopybuf) if (!pselbuf)
errexit(); errexit();
} }
copybufpos += xstrlcpy(pcopybuf + copybufpos, path, len); selbufpos += xstrlcpy(pselbuf + selbufpos, path, len);
} }
/* Write selected file paths to fd, linefeed separated */ /* Write selected file paths to fd, linefeed separated */
static size_t selectiontofd(int fd, uint *pcount) static size_t selectiontofd(int fd, uint *pcount)
{ {
uint lastpos, count = 0; uint lastpos, count = 0;
char *pbuf = pcopybuf; char *pbuf = pselbuf;
size_t pos = 0, len; size_t pos = 0, len;
ssize_t r; ssize_t r;
if (pcount) if (pcount)
*pcount = 0; *pcount = 0;
if (!copybufpos) if (!selbufpos)
return 0; return 0;
lastpos = copybufpos - 1; lastpos = selbufpos - 1;
while (pos <= lastpos) { while (pos <= lastpos) {
len = strlen(pbuf); len = strlen(pbuf);
@ -848,7 +848,7 @@ static bool showcplist(void)
int fd; int fd;
size_t pos; size_t pos;
if (!copybufpos) if (!selbufpos)
return FALSE; return FALSE;
fd = create_tmp_file(); fd = create_tmp_file();
@ -860,7 +860,7 @@ static bool showcplist(void)
pos = selectiontofd(fd, NULL); pos = selectiontofd(fd, NULL);
close(fd); close(fd);
if (pos && pos == copybufpos) if (pos && pos == selbufpos)
spawn(pager, g_tmpfpath, NULL, NULL, F_CLI); spawn(pager, g_tmpfpath, NULL, NULL, F_CLI);
unlink(g_tmpfpath); unlink(g_tmpfpath);
@ -894,7 +894,7 @@ static bool cpsafe(void)
} }
/* Warn if selection not completed */ /* Warn if selection not completed */
if (cfg.copymode) { if (cfg.selmode) {
printmsg("finish selection first"); printmsg("finish selection first");
return FALSE; return FALSE;
} }
@ -908,15 +908,14 @@ static bool cpsafe(void)
return TRUE; return TRUE;
} }
/* Reset copy indicators */ /* Reset selection indicators */
static void resetcpind(void) static void resetcpind(void)
{ {
int r = 0; int r = 0;
/* Reset copy indicators */
for (; r < ndents; ++r) for (; r < ndents; ++r)
if (dents[r].flags & FILE_COPIED) if (dents[r].flags & FILE_SELECTED)
dents[r].flags &= ~FILE_COPIED; dents[r].flags &= ~FILE_SELECTED;
} }
/* Initialize curses mode */ /* Initialize curses mode */
@ -1217,7 +1216,7 @@ static bool batch_rename(const char *path)
return ret; return ret;
} }
if (!copybufpos) { if (!selbufpos) {
if (!ndents) if (!ndents)
return TRUE; return TRUE;
@ -1232,7 +1231,7 @@ static bool batch_rename(const char *path)
close(fd2); close(fd2);
if (dir) if (dir)
copybufpos = 0; selbufpos = 0;
spawn(editor, g_tmpfpath, NULL, path, F_CLI); spawn(editor, g_tmpfpath, NULL, path, F_CLI);
@ -2019,12 +2018,12 @@ static size_t mkpath(char *dir, char *name, char *out)
static int xlink(char *suffix, char *path, char *buf, int *presel, int type) static int xlink(char *suffix, char *path, char *buf, int *presel, int type)
{ {
int count = 0; int count = 0;
char *pbuf = pcopybuf, *fname; char *pbuf = pselbuf, *fname;
size_t pos = 0, len, r; size_t pos = 0, len, r;
int (*link_fn)(const char *, const char *) = NULL; int (*link_fn)(const char *, const char *) = NULL;
/* Check if selection is empty */ /* Check if selection is empty */
if (!copybufpos) { if (!selbufpos) {
printwait(messages[NONE_SELECTED], presel); printwait(messages[NONE_SELECTED], presel);
return -1; return -1;
} }
@ -2034,7 +2033,7 @@ static int xlink(char *suffix, char *path, char *buf, int *presel, int type)
else /* hard link */ else /* hard link */
link_fn = &link; link_fn = &link;
while (pos < copybufpos) { while (pos < selbufpos) {
len = strlen(pbuf); len = strlen(pbuf);
fname = xbasename(pbuf); fname = xbasename(pbuf);
r = mkpath(path, fname, buf); r = mkpath(path, fname, buf);
@ -2307,7 +2306,7 @@ static void printent(const struct entry *ent, int sel, uint namecols)
if (sel) if (sel)
attron(A_REVERSE); attron(A_REVERSE);
addch((ent->flags & FILE_COPIED) ? '+' : ' '); addch((ent->flags & FILE_SELECTED) ? '+' : ' ');
addwstr(wstr); addwstr(wstr);
if (ind) if (ind)
addch(ind); addch(ind);
@ -2320,7 +2319,7 @@ static void printent(const struct entry *ent, int sel, uint namecols)
static void printent_long(const struct entry *ent, int sel, uint namecols) static void printent_long(const struct entry *ent, int sel, uint namecols)
{ {
char timebuf[18], permbuf[4], ind1 = '\0', ind2[] = "\0\0"; char timebuf[18], permbuf[4], ind1 = '\0', ind2[] = "\0\0";
const char cp = (ent->flags & FILE_COPIED) ? '+' : ' '; const char cp = (ent->flags & FILE_SELECTED) ? '+' : ' ';
/* Timestamp */ /* Timestamp */
strftime(timebuf, 18, "%F %R", localtime(&ent->t)); strftime(timebuf, 18, "%F %R", localtime(&ent->t));
@ -2386,9 +2385,9 @@ static void (*printptr)(const struct entry *ent, int sel, uint namecols) = &prin
static void savecurctx(settings *curcfg, char *path, char *curname, int r /* next context num */) static void savecurctx(settings *curcfg, char *path, char *curname, int r /* next context num */)
{ {
settings cfg = *curcfg; settings cfg = *curcfg;
bool copymode = cfg.copymode ? TRUE : FALSE; bool selmode = cfg.selmode ? TRUE : FALSE;
#ifdef DIR_LIMITED_COPY #ifdef DIR_LIMITED_SELECTION
g_crc = 0; g_crc = 0;
#endif #endif
/* Save current context */ /* Save current context */
@ -2412,8 +2411,8 @@ static void savecurctx(settings *curcfg, char *path, char *curname, int r /* nex
g_ctx[r].c_cfg.runplugin = 0; g_ctx[r].c_cfg.runplugin = 0;
} }
/* Continue copy mode */ /* Continue selection mode */
cfg.copymode = copymode; cfg.selmode = selmode;
cfg.curctx = r; cfg.curctx = r;
*curcfg = cfg; *curcfg = cfg;
@ -3164,10 +3163,10 @@ static void redraw(char *path)
/* Enforce scroll/cursor invariants */ /* Enforce scroll/cursor invariants */
move_cursor(cur, 1); move_cursor(cur, 1);
#ifdef DIR_LIMITED_COPY #ifdef DIR_LIMITED_SELECTION
if (cfg.copymode) if (cfg.selmode)
if (g_crc != crc8fast((uchar *)dents, ndents * sizeof(struct entry))) { if (g_crc != crc8fast((uchar *)dents, ndents * sizeof(struct entry))) {
cfg.copymode = 0; cfg.selmode = 0;
DPRINTF_S("selection off"); DPRINTF_S("selection off");
} }
#endif #endif
@ -3239,7 +3238,7 @@ static void redraw(char *path)
if (ndents) { if (ndents) {
char sort[] = "\0 "; char sort[] = "\0 ";
char copymode[] = "\0 "; char selmode[] = "\0 ";
if (cfg.mtimeorder) if (cfg.mtimeorder)
sort[0] = cfg.mtime ? 'T' : 'A'; sort[0] = cfg.mtime ? 'T' : 'A';
@ -3248,19 +3247,19 @@ static void redraw(char *path)
else if (cfg.extnorder) else if (cfg.extnorder)
sort[0] = 'E'; sort[0] = 'E';
if (cfg.copymode) if (cfg.selmode)
copymode[0] = 'Y'; selmode[0] = 'Y';
/* We need to show filename as it may be truncated in directory listing */ /* We need to show filename as it may be truncated in directory listing */
if (!cfg.showdetail || !cfg.blkorder) if (!cfg.showdetail || !cfg.blkorder)
mvprintw(lastln, 0, "%d/%d (%d) %s%s[%s]\n", cur + 1, ndents, nselected, mvprintw(lastln, 0, "%d/%d (%d) %s%s[%s]\n", cur + 1, ndents, nselected,
copymode, sort, unescape(dents[cur].name, NAME_MAX, NULL)); selmode, sort, unescape(dents[cur].name, NAME_MAX, NULL));
else { else {
xstrlcpy(buf, coolsize(dir_blocks << BLK_SHIFT), 12); xstrlcpy(buf, coolsize(dir_blocks << BLK_SHIFT), 12);
c = cfg.apparentsz ? 'a' : 'd'; c = cfg.apparentsz ? 'a' : 'd';
mvprintw(lastln, 0, "%d/%d (%d) %s%cu: %s (%lu files) free: %s [%s]\n", mvprintw(lastln, 0, "%d/%d (%d) %s%cu: %s (%lu files) free: %s [%s]\n",
cur + 1, ndents, nselected, copymode, c, buf, num_files, cur + 1, ndents, nselected, selmode, c, buf, num_files,
coolsize(get_fs_info(path, FREE)), coolsize(get_fs_info(path, FREE)),
unescape(dents[cur].name, NAME_MAX, NULL)); unescape(dents[cur].name, NAME_MAX, NULL));
} }
@ -3274,7 +3273,7 @@ static void browse(char *ipath)
char mark[PATH_MAX] __attribute__ ((aligned)); char mark[PATH_MAX] __attribute__ ((aligned));
char rundir[PATH_MAX] __attribute__ ((aligned)); char rundir[PATH_MAX] __attribute__ ((aligned));
char runfile[NAME_MAX + 1] __attribute__ ((aligned)); char runfile[NAME_MAX + 1] __attribute__ ((aligned));
int r = -1, fd, presel, copystartid = 0, copyendid = 0, onscreen; int r = -1, fd, presel, selstartid = 0, selendid = 0, onscreen;
enum action sel; enum action sel;
bool dir_changed = FALSE; bool dir_changed = FALSE;
struct stat sb; struct stat sb;
@ -3517,7 +3516,7 @@ nochange:
if (cfg.picker && sel == SEL_GOIN) { if (cfg.picker && sel == SEL_GOIN) {
r = mkpath(path, dents[cur].name, newpath); r = mkpath(path, dents[cur].name, newpath);
appendfpath(newpath, r); appendfpath(newpath, r);
writecp(pcopybuf, copybufpos - 1); writecp(pselbuf, selbufpos - 1);
return; return;
} }
@ -3812,7 +3811,7 @@ nochange:
cfg.apparentsz = 0; cfg.apparentsz = 0;
cfg.blkorder = 0; cfg.blkorder = 0;
cfg.extnorder = 0; cfg.extnorder = 0;
cfg.copymode = 0; cfg.selmode = 0;
break; break;
case SEL_ASIZE: case SEL_ASIZE:
cfg.apparentsz ^= 1; cfg.apparentsz ^= 1;
@ -3838,7 +3837,7 @@ nochange:
cfg.mtimeorder = 0; cfg.mtimeorder = 0;
cfg.sizeorder = 0; cfg.sizeorder = 0;
cfg.extnorder = 0; cfg.extnorder = 0;
cfg.copymode = 0; cfg.selmode = 0;
break; break;
case SEL_EXTN: case SEL_EXTN:
cfg.extnorder ^= 1; cfg.extnorder ^= 1;
@ -3846,7 +3845,7 @@ nochange:
cfg.mtimeorder = 0; cfg.mtimeorder = 0;
cfg.apparentsz = 0; cfg.apparentsz = 0;
cfg.blkorder = 0; cfg.blkorder = 0;
cfg.copymode = 0; cfg.selmode = 0;
break; break;
default: /* SEL_MTIME */ default: /* SEL_MTIME */
cfg.mtimeorder ^= 1; cfg.mtimeorder ^= 1;
@ -3854,7 +3853,7 @@ nochange:
cfg.apparentsz = 0; cfg.apparentsz = 0;
cfg.blkorder = 0; cfg.blkorder = 0;
cfg.extnorder = 0; cfg.extnorder = 0;
cfg.copymode = 0; cfg.selmode = 0;
break; break;
} }
@ -3954,28 +3953,29 @@ nochange:
if (!ndents) if (!ndents)
goto nochange; goto nochange;
if (cfg.copymode) { if (cfg.selmode) {
/* /*
* Clear the selection file on first copy. * Clear the selection file on first select.
* *
* This ensures that when the first file path is * This ensures that when the first file path is
* copied into memory (but not written to tmp file * copied into memory (but not written to tmp file
* yet to save on writes), the tmp file is cleared. * yet to save on writes), the tmp file is cleared.
* The user may be in the middle of selection mode op * The user may be in the middle of selection mode op
* and issue a cp, mv of multi-rm assuming the files * and issue a cp, mv of multi-rm assuming the files
* in the copy list would be affected. However, these * in the selection list would be affected. However,
* ops read the source file paths from the tmp file. * these operations read the source file paths from
* the temporary selection file.
*/ */
if (!nselected) if (!nselected)
writecp(NULL, 0); writecp(NULL, 0);
/* Do not select if already selected */ /* Do not select if already selected */
if (!(dents[cur].flags & FILE_COPIED)) { if (!(dents[cur].flags & FILE_SELECTED)) {
r = mkpath(path, dents[cur].name, newpath); r = mkpath(path, dents[cur].name, newpath);
appendfpath(newpath, r); appendfpath(newpath, r);
++nselected; ++nselected;
dents[cur].flags |= FILE_COPIED; dents[cur].flags |= FILE_SELECTED;
} }
/* move cursor to the next entry if this is not the last entry */ /* move cursor to the next entry if this is not the last entry */
@ -3984,30 +3984,30 @@ nochange:
} else { } else {
r = mkpath(path, dents[cur].name, newpath); r = mkpath(path, dents[cur].name, newpath);
if (copybufpos) { if (selbufpos) {
resetcpind(); resetcpind();
/* Keep the copy buf in sync */ /* Keep the selection buffer in sync */
copybufpos = 0; selbufpos = 0;
} }
appendfpath(newpath, r); appendfpath(newpath, r);
writecp(newpath, r - 1); /* Truncate NULL from end */ writecp(newpath, r - 1); /* Truncate NULL from end */
spawn(copier, NULL, NULL, NULL, F_NOTRACE); spawn(copier, NULL, NULL, NULL, F_NOTRACE);
dents[cur].flags |= FILE_COPIED; dents[cur].flags |= FILE_SELECTED;
} }
break; break;
case SEL_SELMUL: case SEL_SELMUL:
cfg.copymode ^= 1; cfg.selmode ^= 1;
if (cfg.copymode) { if (cfg.selmode) {
if (copybufpos) { if (selbufpos) {
resetcpind(); resetcpind();
writecp(NULL, 0); writecp(NULL, 0);
copybufpos = 0; selbufpos = 0;
} }
g_crc = crc8fast((uchar *)dents, ndents * sizeof(struct entry)); g_crc = crc8fast((uchar *)dents, ndents * sizeof(struct entry));
copystartid = cur; selstartid = cur;
nselected = 0; nselected = 0;
mvprintw(xlines - 1, 0, "selection on\n"); mvprintw(xlines - 1, 0, "selection on\n");
xdelay(); xdelay();
@ -4015,45 +4015,45 @@ nochange:
} }
if (!nselected) { /* Handle range selection */ if (!nselected) { /* Handle range selection */
#ifndef DIR_LIMITED_COPY #ifndef DIR_LIMITED_SELECTION
if (g_crc != crc8fast((uchar *)dents, if (g_crc != crc8fast((uchar *)dents,
ndents * sizeof(struct entry))) { ndents * sizeof(struct entry))) {
cfg.copymode = 0; cfg.selmode = 0;
printwait("dir/content changed", &presel); printwait("dir/content changed", &presel);
goto nochange; goto nochange;
} }
#endif #endif
if (cur < copystartid) { if (cur < selstartid) {
copyendid = copystartid; selendid = selstartid;
copystartid = cur; selstartid = cur;
} else } else
copyendid = cur; selendid = cur;
} // fallthrough } // fallthrough
case SEL_SELALL: case SEL_SELALL:
if (sel == SEL_SELALL) { if (sel == SEL_SELALL) {
if (!ndents) if (!ndents)
goto nochange; goto nochange;
cfg.copymode = 0; cfg.selmode = 0;
copybufpos = 0; selbufpos = 0;
nselected = 0; /* Override single/multi path selection */ nselected = 0; /* Override single/multi path selection */
copystartid = 0; selstartid = 0;
copyendid = ndents - 1; selendid = ndents - 1;
} }
if ((!nselected && copystartid < copyendid) || sel == SEL_SELALL) { if ((!nselected && selstartid < selendid) || sel == SEL_SELALL) {
for (r = copystartid; r <= copyendid; ++r) { for (r = selstartid; r <= selendid; ++r) {
appendfpath(newpath, mkpath(path, dents[r].name, newpath)); appendfpath(newpath, mkpath(path, dents[r].name, newpath));
dents[r].flags |= FILE_COPIED; dents[r].flags |= FILE_SELECTED;
} }
nselected = copyendid - copystartid + 1; nselected = selendid - selstartid + 1;
mvprintw(xlines - 1, 0, "%d selected\n", nselected); mvprintw(xlines - 1, 0, "%d selected\n", nselected);
xdelay(); xdelay();
} }
if (copybufpos) { /* File path(s) written to the buffer */ if (selbufpos) { /* File path(s) written to the buffer */
writecp(pcopybuf, copybufpos - 1); /* Truncate NULL from end */ writecp(pselbuf, selbufpos - 1); /* Truncate NULL from end */
spawn(copier, NULL, NULL, NULL, F_NOTRACE); spawn(copier, NULL, NULL, NULL, F_NOTRACE);
if (nselected) { /* Some files cherry picked */ if (nselected) { /* Some files cherry picked */
@ -4433,8 +4433,8 @@ nochange:
/* In vim picker mode, clear selection and exit */ /* In vim picker mode, clear selection and exit */
if (cfg.picker) { if (cfg.picker) {
/* Picker mode: reset buffer or clear file */ /* Picker mode: reset buffer or clear file */
if (copybufpos) if (selbufpos)
cfg.pickraw ? copybufpos = 0 : writecp(NULL, 0); cfg.pickraw ? selbufpos = 0 : writecp(NULL, 0);
} else if (!write_lastdir(path)) { } else if (!write_lastdir(path)) {
presel = MSGWAIT; presel = MSGWAIT;
goto nochange; goto nochange;
@ -4449,7 +4449,7 @@ nochange:
}; };
if (r != fd) { if (r != fd) {
bool copymode = cfg.copymode ? TRUE : FALSE; bool selmode = cfg.selmode ? TRUE : FALSE;
g_ctx[fd].c_cfg.ctxactive = 0; g_ctx[fd].c_cfg.ctxactive = 0;
@ -4465,8 +4465,8 @@ nochange:
cfg = g_ctx[r].c_cfg; cfg = g_ctx[r].c_cfg;
/* Continue copy mode */ /* Continue selection mode */
cfg.copymode = copymode; cfg.selmode = selmode;
cfg.curctx = r; cfg.curctx = r;
setdirwatch(); setdirwatch();
goto begin; goto begin;
@ -4924,16 +4924,16 @@ int main(int argc, char *argv[])
#endif #endif
if (cfg.pickraw) { if (cfg.pickraw) {
if (copybufpos) { if (selbufpos) {
opt = selectiontofd(1, NULL); opt = selectiontofd(1, NULL);
if (opt != (int)(copybufpos)) if (opt != (int)(selbufpos))
xerror(); xerror();
} }
} else if (!cfg.picker && g_cppath) } else if (!cfg.picker && g_cppath)
unlink(g_cppath); unlink(g_cppath);
/* Free the copy buffer */ /* Free the selection buffer */
free(pcopybuf); free(pselbuf);
#ifdef LINUX_INOTIFY #ifdef LINUX_INOTIFY
/* Shutdown inotify */ /* Shutdown inotify */

View File

@ -195,21 +195,21 @@ static struct key bindings[] = {
/* Redraw window */ /* Redraw window */
{ CONTROL('L'), SEL_REDRAW }, { CONTROL('L'), SEL_REDRAW },
{ KEY_F(5), SEL_REDRAW }, { KEY_F(5), SEL_REDRAW },
/* Copy currently selected file path */ /* Select current file path */
{ CONTROL('K'), SEL_SEL }, { CONTROL('K'), SEL_SEL },
{ ' ', SEL_SEL }, { ' ', SEL_SEL },
/* Toggle copy multiple file paths */ /* Toggle select multiple files */
{ 'K', SEL_SELMUL }, { 'K', SEL_SELMUL },
{ CONTROL('Y'), SEL_SELMUL }, { CONTROL('Y'), SEL_SELMUL },
/* Select all files in current dir */ /* Select all files in current dir */
{ 'Y', SEL_SELALL }, { 'Y', SEL_SELALL },
/* Show list of copied files */ /* Show list of copied files */
{ 'y', SEL_SELLST }, { 'y', SEL_SELLST },
/* Copy from copy buffer */ /* Copy from selection buffer */
{ 'P', SEL_CP }, { 'P', SEL_CP },
/* Move from copy buffer */ /* Move from selection buffer */
{ 'V', SEL_MV }, { 'V', SEL_MV },
/* Delete from copy buffer */ /* Delete from selection buffer */
{ 'X', SEL_RMMUL }, { 'X', SEL_RMMUL },
/* Delete currently selected */ /* Delete currently selected */
{ CONTROL('X'), SEL_RM }, { CONTROL('X'), SEL_RM },