aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2018-12-01 08:59:19 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2018-12-01 10:29:28 +0530
commit0afb792291d12dc4a601cc89322159bdec39e9c1 (patch)
tree68e8b76a8247c861e1eab9fe004cbea012518522 /src
parent50a44494177476659509eb8adfbaedab7ece7e46 (diff)
downloadnnn-0afb792291d12dc4a601cc89322159bdec39e9c1.tar.gz
Fix #156: Support selection across directories, contexts
Diffstat (limited to 'src')
-rw-r--r--src/nnn.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/nnn.c b/src/nnn.c
index dbc8556..90f8bbf 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -2397,11 +2397,14 @@ static void redraw(char *path)
/* Clear screen */
erase();
+
+#ifdef DIR_LIMITED_COPY
if (cfg.copymode)
if (g_crc != crc8fast((uchar *)dents, ndents * sizeof(struct entry))) {
cfg.copymode = 0;
DPRINTF_S("selection off");
}
+#endif
/* Fail redraw if < than 11 columns, context info prints 10 chars */
if (COLS < 11) {
@@ -2823,7 +2826,9 @@ nochange:
if (cfg.curctx == r)
continue;
+#ifdef DIR_LIMITED_COPY
g_crc = 0;
+#endif
/* Save current context */
xstrlcpy(g_ctx[cfg.curctx].c_name, dents[cur].name, NAME_MAX + 1);
@@ -3072,6 +3077,14 @@ nochange:
}
if (!ncp) { /* Handle range selection */
+#ifndef DIR_LIMITED_COPY
+ if (g_crc != crc8fast((uchar *)dents, ndents * sizeof(struct entry))) {
+ cfg.copymode = 0;
+ printmsg("range error: dir/content changed");
+ DPRINTF_S("range error: dir/content changed");
+ goto nochange;
+ }
+#endif
if (cur < copystartid) {
copyendid = copystartid;
copystartid = cur;