aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-02-28 07:34:02 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-02-28 07:34:02 +0530
commit76cf0c65d433f5c694ea2fb4c4edb183f7518e58 (patch)
tree95ece3461fb048d4cbb347c0c9f5ee9f8c1d720c /src
parentfc805dac2665041dd8f614bdd01cfd0974d4fc76 (diff)
downloadnnn-76cf0c65d433f5c694ea2fb4c4edb183f7518e58.tar.gz
Hover next file on delete
Diffstat (limited to 'src')
-rw-r--r--src/nnn.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 6c6c405..a7bd4f0 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;
}
}