mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 20:01:27 +00:00
Skip a complete erase on redraw()
This commit is contained in:
parent
0eeae6ee7b
commit
41d414c2fc
25
src/nnn.c
25
src/nnn.c
|
@ -5752,18 +5752,19 @@ static void redraw(char *path)
|
||||||
|
|
||||||
DPRINTF_S(__func__);
|
DPRINTF_S(__func__);
|
||||||
|
|
||||||
/* Clear screen */
|
|
||||||
erase();
|
|
||||||
|
|
||||||
/* Enforce scroll/cursor invariants */
|
|
||||||
move_cursor(cur, 1);
|
|
||||||
|
|
||||||
/* Fail redraw if < than 10 columns, context info prints 10 chars */
|
/* Fail redraw if < than 10 columns, context info prints 10 chars */
|
||||||
if (ncols < MIN_DISPLAY_COLS) {
|
/* Note: this should be before the Fast redraw, but we optimize */
|
||||||
|
if (ncols <= MIN_DISPLAY_COLS) {
|
||||||
|
erase();
|
||||||
printmsg(messages[MSG_FEW_COLUMNS]);
|
printmsg(messages[MSG_FEW_COLUMNS]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
move(0, 0);
|
||||||
|
|
||||||
|
/* Enforce scroll/cursor invariants */
|
||||||
|
//move_cursor(cur, 1);
|
||||||
|
|
||||||
//DPRINTF_D(cur);
|
//DPRINTF_D(cur);
|
||||||
DPRINTF_S(path);
|
DPRINTF_S(path);
|
||||||
|
|
||||||
|
@ -5824,11 +5825,13 @@ static void redraw(char *path)
|
||||||
|
|
||||||
ncols = adjust_cols(ncols);
|
ncols = adjust_cols(ncols);
|
||||||
|
|
||||||
/* Go to first entry */
|
clrtoeol(); /* Clear to end of first line */
|
||||||
if (curscroll > 0) {
|
|
||||||
move(1, 0);
|
move(1, 0);
|
||||||
|
/* Go to first entry */
|
||||||
|
if (curscroll > 0)
|
||||||
addch('^');
|
addch('^');
|
||||||
}
|
clrtoeol(); /* Clear to end of second line */
|
||||||
|
|
||||||
move(2, 0);
|
move(2, 0);
|
||||||
|
|
||||||
|
@ -5847,6 +5850,8 @@ static void redraw(char *path)
|
||||||
g_state.dircolor = 0;
|
g_state.dircolor = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
clrtobot(); /* clear to end of screen */
|
||||||
|
|
||||||
/* Go to first entry */
|
/* Go to first entry */
|
||||||
if (i < ndents) {
|
if (i < ndents) {
|
||||||
move(xlines - 2, 0);
|
move(xlines - 2, 0);
|
||||||
|
|
Loading…
Reference in a new issue