aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-02-23 12:11:53 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-02-23 12:11:53 +0530
commitd37b67b77b5aa8e7dd8659f37cc6cf6f281cc12e (patch)
tree381810af9d5a3b82d3a5a8b1e612cbfd81213ef7
parent59a5db2c90a1a46ee6332db8107000fa4d4a4df0 (diff)
downloadnnn-d37b67b77b5aa8e7dd8659f37cc6cf6f281cc12e.tar.gz
checkpatch fix: refactor cd on quit
-rw-r--r--src/nnn.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/nnn.c b/src/nnn.c
index d7abbc8..9cd406b 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -3952,12 +3952,10 @@ nochange:
if (sel == SEL_QUITCD) {
/* In vim picker mode, clear selection and exit */
if (cfg.picker) {
- if (copybufpos) {
- if (cfg.pickraw) /* Reset for for raw pick */
- copybufpos = 0;
- else /* Clear the picker file */
- writecp(NULL, 0);
- }
+ /* Picker mode: reset buffer or clear file */
+ if (copybufpos)
+ cfg.pickraw ? copybufpos = 0 : writecp(NULL, 0);
+
dentfree(dents);
return;
}