aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-03-14 20:22:38 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-03-14 20:22:58 +0530
commit1e53cd8ea16ace9dd9289e50b55673f51f740894 (patch)
tree1752e6257a8d4e06ff3cee8025e30d3d62c72d7d
parentd4b0ffa75e31f58b283d044fdb66e75366fe5b41 (diff)
downloadnnn-1e53cd8ea16ace9dd9289e50b55673f51f740894.tar.gz
Highlight the last copied/moved file
-rw-r--r--src/nnn.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 76d448b..8f5fa27 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -4446,7 +4446,6 @@ static int dentfill(char *path, struct entry **dents)
dentp->size = sb.st_size;
#endif
dentp->flags = S_ISDIR(sb.st_mode) ? 0 : ((sb.st_nlink > 1) ? HARD_LINK : 0);
- DPRINTF_D(dentp->flags);
if (cfg.blkorder) {
if (S_ISDIR(sb.st_mode)) {
@@ -5789,6 +5788,11 @@ nochange:
}
}
+ if (nselected == 1 && (sel == SEL_CP || sel == SEL_MV))
+ mkpath(path, xbasename(pselbuf), newpath);
+ else
+ newpath[0] = '\0';
+
endselection();
if (!cpmvrm_selection(sel, path, &presel))
@@ -5797,10 +5801,15 @@ nochange:
clearfilter();
/* Show notification on operation complete */
- if (cfg.x11)
- plugscript(utils[UTIL_NTFY], newpath, NULL, F_NOWAIT | F_NOTRACE);
+ if (cfg.x11) {
+ /* rundir is used as tmp var, note that we MUST clear it again */
+ plugscript(utils[UTIL_NTFY], rundir, NULL, F_NOWAIT | F_NOTRACE);
+ rundir[0] = '\0';
+ }
- if (ndents)
+ if (newpath[0])
+ xstrlcpy(lastname, xbasename(newpath), NAME_MAX+1);
+ else if (ndents)
copycurname();
goto begin;
}