commit f3a441043dd396c280b759e40d0dacab78fb1984
parent e6c629951f321fe1f932cace76529b2512c202ae
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Tue, 25 Jun 2019 08:28:10 +0200
display: where needed, use slow blanking, but elsewhere do it much faster
Where the row needs to be filled with spaces with the attributes that
were set (title bar, prompt bar, and browser highlight), use printw().
But when the row needs to be actually cleared, use the much faster
clrtoeol().
This reduces the time needed to clear a full row with 95 percent.
Diffstat:
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/browser.c b/src/browser.c
@@ -532,7 +532,7 @@ void browser_refresh(void)
the_column = col;
}
- blank_row(edit, row, col, longest);
+ mvwprintw(edit, row, col, "%*s", longest, " ");
/* If the name is too long, we display something like "...ename". */
if (dots)
diff --git a/src/prompt.c b/src/prompt.c
@@ -394,7 +394,7 @@ void draw_the_promptbar(void)
/* Color the promptbar over its full width. */
wattron(bottomwin, interface_color_pair[TITLE_BAR]);
- blank_statusbar();
+ mvwprintw(bottomwin, 0, 0, "%*s", COLS, " ");
mvwaddstr(bottomwin, 0, 0, prompt);
waddch(bottomwin, ':');
@@ -697,7 +697,7 @@ int do_yesno_prompt(bool all, const char *msg)
/* Color the statusbar over its full width and display the question. */
wattron(bottomwin, interface_color_pair[TITLE_BAR]);
- blank_statusbar();
+ mvwprintw(bottomwin, 0, 0, "%*s", COLS, " ");
mvwaddnstr(bottomwin, 0, 0, msg, actual_x(msg, COLS - 1));
wattroff(bottomwin, interface_color_pair[TITLE_BAR]);
wnoutrefresh(bottomwin);
diff --git a/src/winio.c b/src/winio.c
@@ -1794,13 +1794,14 @@ const keystruct *get_shortcut(int *kbinput)
* current attributes. */
void blank_row(WINDOW *win, int y, int x, int n)
{
- mvwprintw(win, y, x, "%*s", n, " ");
+ wmove(win, y, 0);
+ wclrtoeol(win);
}
/* Blank the first line of the top portion of the window. */
void blank_titlebar(void)
{
- blank_row(topwin, 0, 0, COLS);
+ mvwprintw(topwin, 0, 0, "%*s", COLS, " ");
}
/* Blank all the lines of the middle portion of the window, i.e. the