nnn.1 | 4 ++++ src/nnn.c | 9 +++++++-- diff --git a/nnn.1 b/nnn.1 index 069faee02cd9d80b8a4c225c4792df8ea33a00f0..9b29db9e3b7de1b0a09ea31e7f5d8db4062b1b88 100644 --- a/nnn.1 +++ b/nnn.1 @@ -18,6 +18,7 @@ .Op Ar -f .Op Ar -F .Op Ar -g .Op Ar -H +.Op Ar -J .Op Ar -K .Op Ar -l .Op Ar -n @@ -94,6 +95,9 @@ use regex filters instead of substring match .Pp .Fl H show hidden files +.Pp +.Fl J + disable auto-proceed on select .Pp .Fl K test for keybind collision diff --git a/src/nnn.c b/src/nnn.c index 800b88ce8624a8a36b2328a62786d5d588a10a56..0791f1e630daaaa08a31766658e505c41705eb8c 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -314,6 +314,7 @@ uint runctx : 2; /* The context in which plugin is to be run */ uint selmode : 1; /* Set when selecting files */ uint oldcolor : 1; /* Show dirs in context colors */ uint reserved : 14; + uint stayonsel : 1; /* Disable auto-proceed on select */ } runstate; /* Contexts or workspaces */ @@ -6461,7 +6462,7 @@ rightclicksel = 0; else #endif /* move cursor to the next entry if this is not the last entry */ - if (!g_state.picker && cur != ndents - 1) + if (!g_state.stayonsel && !g_state.picker && cur != ndents - 1) move_cursor((cur + 1) % ndents, 0); break; case SEL_SELMUL: @@ -7256,6 +7257,7 @@ #endif " -F show fortune\n" " -g regex filters [default: string]\n" " -H show hidden files\n" + " -J no auto-proceed on select\n" " -K detect key collision\n" " -l val set scroll lines\n" " -n type-to-nav mode\n" @@ -7417,7 +7419,7 @@ #endif while ((opt = (env_opts_id > 0 ? env_opts[--env_opts_id] - : getopt(argc, argv, "aAb:cCdeEfFgHKl:nop:P:QrRs:St:T:uVwxh"))) != -1) { + : getopt(argc, argv, "aAb:cCdeEfFgHJKl:nop:P:QrRs:St:T:uVwxh"))) != -1) { switch (opt) { #ifndef NOFIFO case 'a': @@ -7461,6 +7463,9 @@ filterfn = &visible_re; break; case 'H': cfg.showhidden = 1; + break; + case 'J': + g_state.stayonsel = 1; break; case 'K': check_key_collision();