aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2018-11-09 01:43:35 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2018-11-09 01:43:35 +0530
commit61452102efc90c1fab1e8f314b267b54ab76fc97 (patch)
treebb6540065331453e5aefd9efe8f51abab3c3e6b9
parent0a1e54b78b94816f1a804237172fa92456605a3d (diff)
downloadnnn-61452102efc90c1fab1e8f314b267b54ab76fc97.tar.gz
Remember the last visited file
-rw-r--r--nnn.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/nnn.c b/nnn.c
index 03b8d6d..e3ac053 100644
--- a/nnn.c
+++ b/nnn.c
@@ -2763,7 +2763,7 @@ nochange:
g_crc = 0;
/* Save current context */
- xstrlcpy(g_ctx[cfg.curctx].c_name, oldname, NAME_MAX + 1);
+ xstrlcpy(g_ctx[cfg.curctx].c_name, dents[cur].name, NAME_MAX + 1);
xstrlcpy(g_ctx[cfg.curctx].c_fltr, fltr, NAME_MAX + 1);
xstrlcpy(g_ctx[cfg.curctx].c_path, path, PATH_MAX);
xstrlcpy(g_ctx[cfg.curctx].c_last, lastdir, PATH_MAX);
@@ -2772,7 +2772,7 @@ nochange:
if (!g_ctx[r].c_cfg.ctxactive) {
/* Setup a new context from current context */
g_ctx[r].c_cfg.ctxactive = 1;
- xstrlcpy(g_ctx[r].c_name, oldname, NAME_MAX + 1);
+ xstrlcpy(g_ctx[r].c_name, dents[cur].name, NAME_MAX + 1);
xstrlcpy(g_ctx[r].c_fltr, fltr, NAME_MAX + 1);
xstrlcpy(g_ctx[r].c_path, path, PATH_MAX);
xstrlcpy(g_ctx[r].c_init, path, PATH_MAX);