aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-04-16 17:45:58 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-04-16 17:45:58 +0530
commitddaddcaf218ea2b1600e72e344e8c8720cd03c97 (patch)
tree0a25f4b6d6f1ef356b3aa5dbe7600546630a51d0
parent37ebf8054f4fd6cde9964557f7fbfb00c8460847 (diff)
downloadnnn-ddaddcaf218ea2b1600e72e344e8c8720cd03c97.tar.gz
Experimental: guards to reduce repeat screen redraws
-rw-r--r--src/nnn.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 97e12b8..b6bb768 100644
--- 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)