From: Martin Roa Villescas Date: Sat, 1 Aug 2020 16:35:13 +0000 (+0200) Subject: Write last dir on quit in vim picker mode X-Git-Tag: v3.4~54 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=e557bd2ed90db94e21eb9b192e955fde8aa53e4e;p=nnn.git Write last dir on quit in vim picker mode --- diff --git a/src/nnn.c b/src/nnn.c index dbcd7a3e..e0d75ae5 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -6615,10 +6615,11 @@ nochange: save_session(TRUE, NULL); /* CD on Quit */ - /* In vim picker mode, clear selection and exit */ - /* Picker mode: reset buffer or clear file */ - if (sel == SEL_QUITCD || getenv("NNN_TMPFILE")) - g_state.picker ? selbufpos = 0 : write_lastdir(path); + if (sel == SEL_QUITCD || getenv("NNN_TMPFILE")) { + write_lastdir(path); + if (g_state.picker) + selbufpos = 0; + } return sel == SEL_QUITFAIL ? EXIT_FAILURE : EXIT_SUCCESS; #ifndef NOFIFO case SEL_FIFO: