]> Sergey Matveev's repositories - nnn.git/commitdiff
Experimental: guards to reduce repeat screen redraws
authorArun Prakash Jana <engineerarun@gmail.com>
Thu, 16 Apr 2020 12:15:58 +0000 (17:45 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Thu, 16 Apr 2020 12:15:58 +0000 (17:45 +0530)
src/nnn.c

index 97e12b8ac83d024eb39a59d5dbbbdc66bae4ff08..b6bb768d525066ecdd348e4988324e1cd0f14458 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -4917,8 +4917,6 @@ static void redraw(char *path)
        xlines = LINES;
        xcols = COLS;
 
-       DPRINTF_S(__FUNCTION__);
-
        int ncols = (xcols <= PATH_MAX) ? xcols : PATH_MAX;
        int onscreen = xlines - 4;
        int i;
@@ -4932,6 +4930,8 @@ static void redraw(char *path)
                        return draw_line(path, ncols);
        }
 
+       DPRINTF_S(__FUNCTION__);
+
        /* Clear screen */
        erase();
 
@@ -5141,7 +5141,9 @@ begin:
 #endif
 
        while (1) {
-               redraw(path);
+               /* Do not do a double redraw in filterentries */
+               if ((presel != FILTER) || !filterset())
+                       redraw(path);
 
                /* Display a one-time message */
                if (listpath && (g_states & STATE_MSG)) {
@@ -5667,8 +5669,10 @@ nochange:
                        /* In case of successful operation, reload contents */
 
                        /* Continue in type-to-nav mode, if enabled */
-                       if ((cfg.filtermode || filterset()) && !refresh)
-                               break;
+                       if ((cfg.filtermode || filterset()) && !refresh) {
+                               presel = FILTER;
+                               goto nochange;
+                       }
 
                        /* Save current */
                        if (ndents)