From: Arun Prakash Jana Date: Fri, 28 Feb 2020 02:04:02 +0000 (+0530) Subject: Hover next file on delete X-Git-Tag: v3.1~127 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=76cf0c65d433f5c694ea2fb4c4edb183f7518e58;p=nnn.git Hover next file on delete --- diff --git a/src/nnn.c b/src/nnn.c index 6c6c4050..a7bd4f08 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -5700,18 +5700,22 @@ nochange: } if (r == 'c') { - tmp = (g_listpath && xstrcmp(path, g_listpath) == 0) ? g_prefixpath : path; + tmp = (g_listpath && xstrcmp(path, g_listpath) == 0) + ? g_prefixpath : path; mkpath(tmp, dents[cur].name, newpath); xrm(newpath); - if (cur && access(newpath, F_OK) == -1) { - move_cursor(cur - 1, 0); + if (cfg.filtermode) + presel = FILTER; + + if (access(newpath, F_OK) == 0) /* File not removed */ + goto nochange; + else if (cur) { + cur += (cur != (ndents - 1)) ? 1 : -1; copycurname(); } else lastname[0] = '\0'; - if (cfg.filtermode) - presel = FILTER; goto begin; } }