]> Sergey Matveev's repositories - nnn.git/commitdiff
Picker mode: don't pick on Enter if selection exists
authorArun Prakash Jana <engineerarun@gmail.com>
Tue, 19 Oct 2021 13:17:50 +0000 (18:47 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Tue, 19 Oct 2021 13:20:11 +0000 (18:50 +0530)
src/nnn.c

index 8499489aa8691e34fb7e5be9eb759d110df2646e..238af1aa1b7712b3bf0ba6d47b59a1aefaa3dc9f 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -6828,7 +6828,7 @@ nochange:
 #endif
                        /* If opened as vim plugin and Enter/^M pressed, pick */
                        if (g_state.picker && (sel == SEL_OPEN)) {
-                               if (!(pdents[cur].flags & FILE_SELECTED))
+                               if (nselected == 0) /* Pick if none selected */
                                        appendfpath(newpath, mkpath(path, pent->name, newpath));
                                return EXIT_SUCCESS;
                        }
@@ -7263,7 +7263,7 @@ nochange:
                        else
 #endif
                                /* move cursor to the next entry if this is not the last entry */
-                               if (!g_state.stayonsel && !g_state.picker && cur != ndents - 1)
+                               if (!g_state.stayonsel && (cur != ndents - 1))
                                        move_cursor((cur + 1) % ndents, 0);
                        break;
                case SEL_SELMUL: