aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar 0xACE <0xaced@gmail.com>2019-07-12 14:55:03 +0200
committerGravatar 0xACE <0xaced@gmail.com>2019-07-12 14:55:03 +0200
commitd640de258963ed174321cd161871da66cf2f4931 (patch)
tree904f9133997abd89870e2373ff79ae9d21affdb7 /src
parent78ada7a8bc0f2622af461f54dc80abf10abf6f1c (diff)
downloadnnn-d640de258963ed174321cd161871da66cf2f4931.tar.gz
Keep lastname directory selected
incase the user just lost access, it would be better to remember the selected directory to keep it highlighted.
Diffstat (limited to 'src')
-rw-r--r--src/nnn.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 4bcc55b..bb2e285 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -3301,6 +3301,9 @@ nochange:
if (access(path, F_OK)) {
DPRINTF_S("dir deleted or moved");
+ /* Save history */
+ xstrlcpy(lastname, xbasename(path), NAME_MAX + 1);
+
xstrlcpy(newpath, path, PATH_MAX);
while (true) {
dir = visit_parent(path, newpath, &presel);