]> Sergey Matveev's repositories - nnn.git/commitdiff
Pin current path on archive/remote mount
authorArun Prakash Jana <engineerarun@gmail.com>
Sat, 27 Jun 2020 16:52:20 +0000 (22:22 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Sat, 27 Jun 2020 16:52:20 +0000 (22:22 +0530)
src/nnn.c

index 4e1405777c3d196bb945d213e77231aa8c20a002..5da3653a53d4f479af7f8a1d5b6bdd3e6b7ef209 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -5737,6 +5737,10 @@ nochange:
                                                        goto nochange;
                                                }
 
+                                               /* Pin current directory */
+                                               free(mark);
+                                               mark = xstrdup(path);
+
                                                cdprep(lastdir, lastname, path, newpath)
                                                        ? (presel = FILTER) : (watch = TRUE);
                                                goto begin;
@@ -5827,6 +5831,10 @@ nochange:
                                goto nochange;
                        }
 
+                       /* Pin current directory */
+                       free(mark);
+                       mark = xstrdup(path);
+
                        /* In list mode, retain the last file name to highlight it, if possible */
                        cdprep(lastdir, listpath && sel == SEL_CDLAST ? NULL : lastname, path, newpath)
                               ? (presel = FILTER) : (watch = TRUE);