]> Sergey Matveev's repositories - nnn.git/commitdiff
Fix #155: do not discard seleciton on Enter
authorArun Prakash Jana <engineerarun@gmail.com>
Fri, 30 Nov 2018 15:22:07 +0000 (20:52 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Fri, 30 Nov 2018 15:22:07 +0000 (20:52 +0530)
src/nnn.c

index 89f2f0fd84d40a6bd53ee0c4546a10afab43e145..a49bd34d549eade6e8302c437f7439b4df6b23ed 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -2653,10 +2653,8 @@ nochange:
                                /* If opened as vim plugin and Enter/^M pressed, pick */
                                if (cfg.picker && sel == SEL_GOIN) {
                                        r = mkpath(path, dents[cur].name, newpath, PATH_MAX);
-                                       /* NOTE: This overrides any previous selection */
-                                       copybufpos = 0;
                                        appendfpath(newpath, r);
-                                       writecp(newpath, r - 1);
+                                       writecp(pcopybuf, copybufpos - 1);
 
                                        dentfree(dents);
                                        return;