]> Sergey Matveev's repositories - nnn.git/commitdiff
No re-filter on MSGWAIT
authorArun Prakash Jana <engineerarun@gmail.com>
Sun, 29 Mar 2020 08:06:07 +0000 (13:36 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Sun, 29 Mar 2020 08:33:11 +0000 (14:03 +0530)
src/.clang-tidy
src/nnn.c

index a9606bd7bfb12a0d5fdcd93616cee7d9eebc3197..f94a365fde69fc7acb7365acce2d71115d6037c0 100644 (file)
@@ -11,5 +11,5 @@ CheckOptions:
   - key:             fuchsia-restrict-system-includes.Includes
     value:           '*,-stdint.h,-stdbool.h'
   - key:             readability-function-size.StatementThreshold
-    value:           '905'
+    value:           '900'
 ...
index 53951b2d1ce3720d57cc9cee3c48a288042545e3..23383d2e5fdbf32dab7ca6f9a9e92ecf9b6240b9 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -2310,8 +2310,8 @@ static int nextsel(int presel)
                //DPRINTF_D(c);
                //DPRINTF_S(keyname(c));
 
-               if (c == ERR && presel == MSGWAIT)
-                       c = (cfg.filtermode || filterset()) ? FILTER : CONTROL('L');
+               if (c == ERR)
+                       c = 0;
                else if (c == FILTER || c == CONTROL('L'))
                        /* Clear previous filter when manually starting */
                        clearfilter();
@@ -5225,8 +5225,11 @@ nochange:
                }
 
                sel = nextsel(presel);
-               if (presel)
+               if (presel) {
+                       if (presel == MSGWAIT)
+                               statusbar(path);
                        presel = 0;
+               }
 
                switch (sel) {
 #ifndef NOMOUSE
@@ -5897,20 +5900,17 @@ nochange:
                                        mkpath(tmp, dents[cur].name, newpath);
                                        xrm(newpath);
 
-                                       if (cfg.filtermode || filterset())
-                                               presel = FILTER;
+                                       if (access(newpath, F_OK) == 0) /* File not removed */
+                                               continue;
 
-                                       if (access(newpath, F_OK) == 0) { /* File not removed */
-                                               copycurname();
-                                               if (!cfg.filtermode)
-                                                       statusbar(path);
-                                               goto nochange;
-                                       } else if (ndents) {
+                                       if (ndents) {
                                                cur += (cur != (ndents - 1)) ? 1 : -1;
                                                copycurname();
                                        } else
                                                lastname[0] = '\0';
 
+                                       if (cfg.filtermode || filterset())
+                                               presel = FILTER;
                                        goto begin;
                                }
                        }
@@ -6028,12 +6028,9 @@ nochange:
                                if (access(newpath, F_OK) == 0) { /* File created */
                                        xstrlcpy(lastname, tmp, NAME_MAX + 1);
                                        clearfilter(); /* Archive name may not match */
-                               } else {
-                                       if (cfg.filtermode)
-                                               presel = FILTER;
-                                       copycurname();
+                                       goto begin;
                                }
-                               goto begin;
+                               continue;
                        case SEL_OPENWITH:
                                /* Confirm if app is CLI or GUI */
                                r = get_input(messages[MSG_CLI_MODE]);
@@ -6219,12 +6216,8 @@ nochange:
                                break;
                        case SEL_LAUNCH:
                                launch_app(path, newpath);
-
-                               if (cfg.filtermode)
-                                       presel = FILTER;
-                               if (ndents)
-                                       copycurname();
-                               goto nochange;
+                               r = FALSE;
+                               break;
                        default: /* SEL_RUNCMD */
                                r = TRUE;
 #ifndef NORL