]> Sergey Matveev's repositories - nnn.git/commitdiff
remove program option -f
authorArun Prakash Jana <engineerarun@gmail.com>
Sat, 14 Dec 2019 14:54:42 +0000 (20:24 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Sat, 14 Dec 2019 14:55:23 +0000 (20:25 +0530)
misc/auto-completion/bash/nnn-completion.bash
misc/auto-completion/fish/nnn.fish
misc/auto-completion/zsh/_nnn
nnn.1
src/nnn.c

index cbcc8144867b474cae141bb2b3bb680af8016e8d..e9061c7bea841589a8225a1ae881cd74870ade05 100644 (file)
@@ -18,7 +18,6 @@ _nnn ()
         -d
         -e
         -E
-        -f
         -g
         -H
         -i
index 164aaaaa5db67b530f3f237d4c07a5b3c1c08c2e..e459aa3d1788585b3d86f67ccc8bc84eb71afb0b 100644 (file)
@@ -17,7 +17,6 @@ complete -c nnn -s c    -d 'cli-only opener'
 complete -c nnn -s d    -d 'start in detail mode'
 complete -c nnn -s e -r -d 'load session by name' -x -a '@\t"last session" (ls $sessions_dir)'
 complete -c nnn -s E    -d 'use EDITOR for undetached edits'
-complete -c nnn -s f    -d 'run filter as cmd on prompt key'
 complete -c nnn -s g    -d 'regex filters'
 complete -c nnn -s H    -d 'show hidden files'
 complete -c nnn -s i    -d 'start in navigate-as-you-type mode'
index a7ce0ba61c70490e22e02706f4b6684569acfce2..777894f5cdca329a252c8357c3736640f9be9f7b 100644 (file)
@@ -15,7 +15,6 @@ args=(
     '(-d)-d[start in detail mode]'
     '(-e)-e[load session]:session name'
     '(-E)-E[use EDITOR for undetached edits]'
-    '(-f)-f[run filter as cmd on prompt key]'
     '(-g)-g[regex filters]'
     '(-H)-H[show hidden files]'
     '(-i)-i[start in navigate-as-you-type mode]'
diff --git a/nnn.1 b/nnn.1
index 5345ba89b1152f978b8bc1effd8366856483ef1e..fcb8f2d8cce8aa60345f2c0ffe4fbb8268cff88a 100644 (file)
--- a/nnn.1
+++ b/nnn.1
@@ -12,7 +12,6 @@
 .Op Ar -d
 .Op Ar -e name
 .Op Ar -E
-.Op Ar -f
 .Op Ar -g
 .Op Ar -H
 .Op Ar -i
@@ -62,9 +61,6 @@ supports the following options:
 .Fl E
         use $EDITOR for internal undetached edits
 .Pp
-.Fl f
-        run filter as command when the prompt key is pressed
-.Pp
 .Fl g
         use regex filters instead of substring match
 .Pp
@@ -148,14 +144,12 @@ with a '^' (caret) symbol.
 .br
 (3) Use '.*' to match any character (\fIsort of\fR fuzzy search).
 .Pp
-There is a program option to execute the current filter as a command when the prompt key is pressed.
-.Pp
 In the \fInavigate-as-you-type\fR mode directories are opened in filter mode,
 allowing continuous navigation. Works best with the \fBarrow keys\fR.
 .br
 When there's a unique match and it's a directory,
 .Nm
-auto selects the directory and enters it in this mode.
+auto selects the directory and enters it in this mode. Use the relevant program option to disable this behaviour.
 .Sh SELECTION
 There are 3 groups of keybinds to add files to selection:
 .Pp
index 45aabcaa6a61c0bead326da852598d7006aba7be..883ee9d84bb4e9871a94a11746ef6176aacec8f9 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -227,9 +227,8 @@ typedef struct {
        uint selmode    : 1;  /* Set when selecting files */
        uint showdetail : 1;  /* Clear to show fewer file info */
        uint ctxactive  : 1;  /* Context active or not */
-       uint reserved   : 2;
+       uint reserved   : 3;
        /* The following settings are global */
-       uint x11        : 1;  /* Copy to system clipboard and show notis */
        uint curctx     : 2;  /* Current context number */
        uint dircolor   : 1;  /* Current status of dir color */
        uint picker     : 1;  /* Write selection to user-specified file */
@@ -241,7 +240,7 @@ typedef struct {
        uint runplugin  : 1;  /* Choose plugin mode */
        uint runctx     : 2;  /* The context in which plugin is to be run */
        uint filter_re  : 1;  /* Use regex filters */
-       uint filtercmd  : 1;  /* Run filter as command on no match */
+       uint x11        : 1;  /* Copy to system clipboard and show notis */
        uint trash      : 1;  /* Move removed files to trash */
        uint mtime      : 1;  /* Use modification time (else access time) */
        uint cliopener  : 1;  /* All-CLI app opener */
@@ -282,7 +281,6 @@ static settings cfg = {
        0, /* showdetail */
        1, /* ctxactive */
        0, /* reserved */
-       0, /* x11 */
        0, /* curctx */
        0, /* dircolor */
        0, /* picker */
@@ -294,7 +292,7 @@ static settings cfg = {
        0, /* runplugin */
        0, /* runctx */
        0, /* filter_re */
-       0, /* filtercmd */
+       0, /* x11 */
        0, /* trash */
        1, /* mtime */
        0, /* cliopener */
@@ -2058,28 +2056,10 @@ static int filterentries(char *path)
 
                if (r == OK) {
                        /* Handle all control chars in main loop */
-                       if ((*ch < ASCII_MAX && keyname(*ch)[0] == '^' && *ch != '^')
-                           || (*ch == ']' && len == 1)) {
+                       if (*ch < ASCII_MAX && keyname(*ch)[0] == '^' && *ch != '^') {
                                DPRINTF_D(*ch);
                                DPRINTF_S(keyname(*ch));
 
-                               /* If there's a filter, try a command on ^P */
-                               if (cfg.filtercmd && *ch == CONTROL('P') && len > 1) {
-                                       prompt_run(pln, (ndents ? dents[cur].name : ""), path);
-
-                                       /* Clear the prompt */
-                                       while (len > 1)
-                                               wln[--len] = '\0';
-                                       wcstombs(ln, wln, REGEX_MAX);
-                                       ndents = total;
-                                       cur = oldcur = 0; /* Ran a command, refresh */
-                                       if (matches(pln) != -1)
-                                               redraw(path);
-
-                                       printprompt(ln);
-                                       continue;
-                               }
-
                                if (len == 1)
                                        cur = oldcur;
                                goto end;
@@ -3497,7 +3477,7 @@ static void show_help(const char *path)
                  "cC  Execute file   i ^V  Pick plugin\n"
                  "cs  Manage session    =  Launch app\n"
                  "cc  Connect remote    u  Unmount\n"
-              "9] ^P  Prompt/run cmd    L  Lock\n"};
+              "9] ^P  Prompt            L  Lock\n"};
 
        fd = create_tmp_file();
        if (fd == -1)
@@ -5443,7 +5423,6 @@ static void usage(void)
                " -d      detail mode\n"
                " -e name load session by name\n"
                " -E      use EDITOR for undetached edits\n"
-               " -f      run filter as cmd on prompt key\n"
                " -g      regex filters [default: string]\n"
                " -H      show hidden files\n"
                " -i      nav-as-you-type mode\n"
@@ -5599,7 +5578,7 @@ int main(int argc, char *argv[])
        bool progress = FALSE;
 #endif
 
-       while ((opt = getopt(argc, argv, "HSKiab:cde:Efgnop:rRtvxh")) != -1) {
+       while ((opt = getopt(argc, argv, "HSKiab:cde:Egnop:rRtvxh")) != -1) {
                switch (opt) {
                case 'S':
                        cfg.blkorder = 1;
@@ -5627,9 +5606,6 @@ int main(int argc, char *argv[])
                case 'E':
                        cfg.waitedit = 1;
                        break;
-               case 'f':
-                       cfg.filtercmd = 1;
-                       break;
                case 'g':
                        cfg.filter_re = 1;
                        filterfn = &visible_re;