Fix no file picked with NNN_TMPFILE set and quit with 'q'

If NNN_TMPFILE is exported, the selection buffer gets cleared as it is
combined with `^G` (clear picked files and exit). So even when 'q' is
pressed to quit the program the selection is lost. This was introduced
in commit d1d491c102 after release v2.7.
This commit is contained in:
Arun Prakash Jana 2021-05-16 03:23:03 +05:30
parent 79cbcc18e1
commit 31c34740bc
No known key found for this signature in database
GPG Key ID: A75979F35C080412
1 changed files with 2 additions and 2 deletions

View File

@ -7171,9 +7171,9 @@ nochange:
#endif
/* CD on Quit */
if (sel == SEL_QUITCD || getenv("NNN_TMPFILE")) {
if ((sel == SEL_QUITCD) || getenv("NNN_TMPFILE")) {
write_lastdir(path);
if (g_state.picker)
if ((sel == SEL_QUITCD) && g_state.picker)
selbufpos = 0;
}