]> Sergey Matveev's repositories - nnn.git/commitdiff
Check if file is already selected before appending in picker mode
authorArun Prakash Jana <engineerarun@gmail.com>
Fri, 23 Jul 2021 20:21:20 +0000 (01:51 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Fri, 23 Jul 2021 20:21:20 +0000 (01:51 +0530)
src/nnn.c

index b240a63e3754021dec990bd3a3c3d4558f7e1f6c..e409d708085a69040749488e583e601431d85569 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -6662,8 +6662,8 @@ nochange:
 #endif
                        /* If opened as vim plugin and Enter/^M pressed, pick */
                        if (g_state.picker && (sel == SEL_OPEN)) {
-                               appendfpath(newpath, mkpath(path, pent->name, newpath));
-                               writesel(pselbuf, selbufpos - 1);
+                               if (!(pdents[cur].flags & FILE_SELECTED))
+                                       appendfpath(newpath, mkpath(path, pent->name, newpath));
                                return EXIT_SUCCESS;
                        }