From bbed065fa8e5462fbe0dbc929b6e0e9f99ffbdf1 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sun, 21 Nov 2021 10:37:39 +0100 Subject: [PATCH] tweaks: avoid redrawing the entire window when just a 'touch' will do --- src/nano.c | 4 ++-- src/winio.c | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/nano.c b/src/nano.c index b7cbd9f7..9a7aafa8 100644 --- a/src/nano.c +++ b/src/nano.c @@ -2559,11 +2559,11 @@ int main(int argc, char **argv) if (ISSET(ZERO) && lastmessage > HUSH) { if (openfile->current_y == editwinrows - 1 && LINES > 1) { edit_scroll(FORWARD); - edit_refresh(); + wnoutrefresh(edit); } redrawwin(bottomwin); wnoutrefresh(bottomwin); - wnoutrefresh(edit); + place_the_cursor(); } else if (ISSET(ZERO) && lastmessage > VACUUM) wredrawln(edit, editwinrows - 1, 1); #endif diff --git a/src/winio.c b/src/winio.c index f6c406db..0f080527 100644 --- a/src/winio.c +++ b/src/winio.c @@ -1704,7 +1704,10 @@ void check_statusblank(void) /* When windows overlap, make sure to show the edit window now. */ if (currmenu == MMAIN && (ISSET(ZERO) || LINES == 1)) - edit_refresh(); + { + wredrawln(edit, editwinrows - 1, 1); + wnoutrefresh(edit); + } } /* Ensure that the status bar will be wiped upon the next keystroke. */