aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2018-11-29 20:35:41 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2018-11-29 20:35:41 +0530
commit9876948a46fb9eb3c2a848c740c3b0e3a73f4a31 (patch)
tree89e4f79ff65e676cb8f252db2b12614aea614b0b
parent04b0a38f68b3caf8744f7ba6ee97234689b05ba4 (diff)
downloadnnn-9876948a46fb9eb3c2a848c740c3b0e3a73f4a31.tar.gz
Clear picker file on cancel
-rw-r--r--src/nnn.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/nnn.c b/src/nnn.c
index f2cb9c9..3a92069 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -3394,7 +3394,12 @@ nochange:
if (sel == SEL_QUITCD) {
/* In vim picker mode, clear selection and exit */
if (cfg.picker) {
- copybufpos = 0;
+ if (copybufpos) {
+ if (cfg.pickraw) /* Reset for for raw pick */
+ copybufpos = 0;
+ else /* Clear the picker file */
+ writecp(NULL, 0);
+ }
dentfree(dents);
return;
}