mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 11:51:27 +00:00
Experimental: guards to reduce repeat screen redraws
This commit is contained in:
parent
37ebf8054f
commit
ddaddcaf21
12
src/nnn.c
12
src/nnn.c
|
@ -4917,8 +4917,6 @@ static void redraw(char *path)
|
||||||
xlines = LINES;
|
xlines = LINES;
|
||||||
xcols = COLS;
|
xcols = COLS;
|
||||||
|
|
||||||
DPRINTF_S(__FUNCTION__);
|
|
||||||
|
|
||||||
int ncols = (xcols <= PATH_MAX) ? xcols : PATH_MAX;
|
int ncols = (xcols <= PATH_MAX) ? xcols : PATH_MAX;
|
||||||
int onscreen = xlines - 4;
|
int onscreen = xlines - 4;
|
||||||
int i;
|
int i;
|
||||||
|
@ -4932,6 +4930,8 @@ static void redraw(char *path)
|
||||||
return draw_line(path, ncols);
|
return draw_line(path, ncols);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DPRINTF_S(__FUNCTION__);
|
||||||
|
|
||||||
/* Clear screen */
|
/* Clear screen */
|
||||||
erase();
|
erase();
|
||||||
|
|
||||||
|
@ -5141,6 +5141,8 @@ begin:
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
|
/* Do not do a double redraw in filterentries */
|
||||||
|
if ((presel != FILTER) || !filterset())
|
||||||
redraw(path);
|
redraw(path);
|
||||||
|
|
||||||
/* Display a one-time message */
|
/* Display a one-time message */
|
||||||
|
@ -5667,8 +5669,10 @@ nochange:
|
||||||
/* In case of successful operation, reload contents */
|
/* In case of successful operation, reload contents */
|
||||||
|
|
||||||
/* Continue in type-to-nav mode, if enabled */
|
/* Continue in type-to-nav mode, if enabled */
|
||||||
if ((cfg.filtermode || filterset()) && !refresh)
|
if ((cfg.filtermode || filterset()) && !refresh) {
|
||||||
break;
|
presel = FILTER;
|
||||||
|
goto nochange;
|
||||||
|
}
|
||||||
|
|
||||||
/* Save current */
|
/* Save current */
|
||||||
if (ndents)
|
if (ndents)
|
||||||
|
|
Loading…
Reference in a new issue