]> Sergey Matveev's repositories - nnn.git/commitdiff
Add key ] to show prompt
authorArun Prakash Jana <engineerarun@gmail.com>
Mon, 18 Nov 2019 14:51:00 +0000 (20:21 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Mon, 18 Nov 2019 14:51:00 +0000 (20:21 +0530)
README.md
src/nnn.c
src/nnn.h

index 2c1432b25aa08b3976f091a13cb893656dc65c19..e2c9adfc8ef53b5e60b4555517f6b79915160358 100644 (file)
--- a/README.md
+++ b/README.md
@@ -224,7 +224,7 @@ The list below is from the **dev branch**. Press <kbd>?</kbd> in `nnn` to see th
             C  Execute entry  R ^V  Pick plugin
             U  Manage session    =  Launch
             c  SSHFS mount       u  Unmount
-           ^P  Prompt/run cmd    L  Lock
+         ] ^P  Prompt/run cmd    L  Lock
 ```
 
 Notes:
index 4a7f7e36cfd93b800476b371cc537a11b0446d02..e1d809264e990166da9df1c467a70af76b592415 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -1936,7 +1936,7 @@ static int filterentries(char *path)
                        continue;
 #endif
                case KEY_DC: // fallthrough
-               case  KEY_BACKSPACE: // fallthrough
+               case KEY_BACKSPACE: // fallthrough
                case '\b': // fallthrough
                case CONTROL('L'): // fallthrough
                case 127: /* handle DEL */
@@ -1971,7 +1971,8 @@ static int filterentries(char *path)
 
                if (r == OK) {
                        /* Handle all control chars in main loop */
-                       if (*ch < ASCII_MAX && keyname(*ch)[0] == '^' && *ch != '^') {
+                       if ((*ch < ASCII_MAX && keyname(*ch)[0] == '^' && *ch != '^')
+                           || (*ch == ']' && len == 1)) {
                                DPRINTF_D(*ch);
                                DPRINTF_S(keyname(*ch));
 
@@ -3331,7 +3332,7 @@ static void show_help(const char *path)
                  "cC  Execute entry  R ^V  Pick plugin\n"
                  "cU  Manage session    =  Launch\n"
                  "cc  SSHFS mount       u  Unmount\n"
-                "b^P  Prompt/run cmd    L  Lock\n"};
+              "9] ^P  Prompt/run cmd    L  Lock\n"};
 
        fd = create_tmp_file();
        if (fd == -1)
index 46579f89b60a10c9f4e250bc44fc522704516f65..ff6f8d97149e04d0b965cc7e13354236b305b83f 100644 (file)
--- a/src/nnn.h
+++ b/src/nnn.h
@@ -257,6 +257,7 @@ static struct key bindings[] = {
        /* Launcher */
        { '=',            SEL_LAUNCH },
        /* Run a command */
+       { ']',            SEL_RUNCMD },
        { CONTROL('P'),   SEL_RUNCMD },
        /* Open in EDITOR or PAGER */
        { 'e',            SEL_RUNEDIT },