aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-12-27 09:26:20 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-12-27 09:26:20 +0530
commita32b3eac148f35b4260ebfde898741e1c57a827e (patch)
tree21f38cc8988851e0d90d708259ba20daca9193f3 /src
parentb455abf94474a4be74b074b0690aad4e86d3ff95 (diff)
downloadnnn-a32b3eac148f35b4260ebfde898741e1c57a827e.tar.gz
Code refactor
Diffstat (limited to 'src')
-rw-r--r--src/nnn.c42
1 files changed, 15 insertions, 27 deletions
diff --git a/src/nnn.c b/src/nnn.c
index d929c97..9f69943 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -5460,36 +5460,24 @@ nochange:
break; // fallthrough
}
- if (sel == SEL_QUITCD || getenv("NNN_TMPFILE")) {
- /* In vim picker mode, clear selection and exit */
- if (cfg.picker) {
- /* Picker mode: reset buffer or clear file */
- selbufpos = 0;
- } else if (!write_lastdir(path)) {
- presel = MSGWAIT;
- goto nochange;
- }
- }
+ /* 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"))
+ cfg.picker ? selbufpos = 0 : write_lastdir(path);
return;
default:
- if (xlines != LINES || xcols != COLS) {
- idle = 0;
- setdirwatch();
- if (ndents)
- copycurname();
- goto begin;
- }
-
- /* Locker */
- if (idletimeout && idle == idletimeout) {
- idle = 0;
- lock_terminal();
- if (ndents)
- copycurname();
- goto begin;
- }
+ if (xlines != LINES || xcols != COLS)
+ setdirwatch(); /* Terminal resized */
+ else if (idletimeout && idle == idletimeout)
+ lock_terminal(); /* Locker */
+ else
+ goto nochange;
- goto nochange;
+ idle = 0;
+ if (ndents)
+ copycurname();
+ goto begin;
} /* switch (sel) */
}
}