From: 0xACE <0xaced@gmail.com> Date: Fri, 12 Jul 2019 12:55:03 +0000 (+0200) Subject: Keep lastname directory selected X-Git-Tag: v2.6~48^2 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=d640de258963ed174321cd161871da66cf2f4931;p=nnn.git Keep lastname directory selected incase the user just lost access, it would be better to remember the selected directory to keep it highlighted. --- diff --git a/src/nnn.c b/src/nnn.c index 4bcc55bd..bb2e2858 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);