From 0afb792291d12dc4a601cc89322159bdec39e9c1 Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Sat, 1 Dec 2018 08:59:19 +0530 Subject: Fix #156: Support selection across directories, contexts --- src/nnn.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src') 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; -- cgit v1.2.3-70-g09d2