]> Sergey Matveev's repositories - nnn.git/commitdiff
Disable e on picker mode
authorNRK <nrk@disroot.org>
Thu, 12 Aug 2021 05:17:48 +0000 (11:17 +0600)
committerNRK <nrk@disroot.org>
Thu, 30 Sep 2021 13:54:22 +0000 (19:54 +0600)
Mainly so that pressing 'e' due to muscle memory on nnn.vim doesn't nest
a new editor instance inside the embedded vim terminal.

However invoking nnn with picker mode implies that the intention is to
pick file(s), there shouldn't be any business trying to edit things on
the fly. And if editing a file while in picker mode is desirable, then
'l' can be used for that instead.

src/nnn.c

index e6665e77a3fe1386e42b68df07bca45aab0570de..9ca0240dc7490efad7eb336dd010b7e22b9ddded 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -7206,7 +7206,8 @@ nochange:
                                copycurname();
                                goto nochange;
                        case SEL_EDIT:
-                               spawn(editor, newpath, NULL, NULL, F_CLI);
+                               if (!g_state.picker)
+                                       spawn(editor, newpath, NULL, NULL, F_CLI);
                                continue;
                        default: /* SEL_LOCK */
                                lock_terminal();