]> Sergey Matveev's repositories - nnn.git/commitdiff
Enable filtering in plugins/bookmarks dirs
authorArun Prakash Jana <engineerarun@gmail.com>
Tue, 14 Jun 2022 07:40:54 +0000 (13:10 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Tue, 14 Jun 2022 07:40:54 +0000 (13:10 +0530)
Enable auto-dir entry on filter mode

src/nnn.c

index 3a84222d94684a009a9e6eb691f44c2b0fdc4724..ed673b0623b90ae2b28d0356cd8207e47061bddd 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -3446,8 +3446,7 @@ static int filterentries(char *path, char *lastname)
                }
 
                /* If the only match is a dir, auto-enter and cd into it */
-               if (ndents == 1 && cfg.filtermode
-                   && cfg.autoenter && (pdents[0].flags & DIR_OR_DIRLNK)) {
+               if ((ndents == 1) && cfg.autoenter && (pdents[0].flags & DIR_OR_DIRLNK)) {
                        *ch = KEY_ENTER;
                        cur = 0;
                        goto end;
@@ -7146,6 +7145,8 @@ nochange:
 
                                if (strcmp(path, newpath) == 0)
                                        break;
+                               if (g_state.selbm == 1) /* Allow filtering in bookmarks directory */
+                                       presel = FILTER;
                        }
 
                        /* In list mode, retain the last file name to highlight it, if possible */
@@ -7784,6 +7785,8 @@ nochange:
                        }
                        setdirwatch();
                        clearfilter();
+                       if (g_state.runplugin == 1) /* Allow filtering in plugins directory */
+                               presel = FILTER;
                        goto begin;
                case SEL_SHELL: // fallthrough
                case SEL_LAUNCH: // fallthrough