]> Sergey Matveev's repositories - nnn.git/commitdiff
Show help on typing ? at empty filter prompt
authorArun Prakash Jana <engineerarun@gmail.com>
Sat, 31 Mar 2018 15:28:13 +0000 (20:58 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Sat, 31 Mar 2018 15:32:35 +0000 (21:02 +0530)
nnn.c

diff --git a/nnn.c b/nnn.c
index c6b3e194cc8755c0d77366c3914148cf8a4662c3..a2c9d0f9907275667310fa23c67153920c69d666 100644 (file)
--- a/nnn.c
+++ b/nnn.c
@@ -1164,6 +1164,11 @@ filterentries(char *path)
                                if (len == 1)
                                        cur = oldcur;
                                goto end;
+                       case '?':  // '?' is an invalid regex, show help instead
+                               if (len == 1) {
+                                       cur = oldcur;
+                                       goto end;
+                               } // fallthrough
                        default:
                                /* Reset cur in case it's a repeat search */
                                if (len == 1)
@@ -3184,8 +3189,12 @@ nochange:
                        goto begin;
                case SEL_HELP:
                        show_help(path);
+
+                       /* Continue in navigate-as-you-type mode, if enabled */
+                       if (cfg.filtermode)
+                               presel = FILTER;
                        break;
-               case SEL_RUN: // fallthorugh
+               case SEL_RUN: // fallthrough
                case SEL_RUNSCRIPT:
                        run = xgetenv(env, run);