From 170e7d79e7777b51b4e3217769e9307713229d49 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sun, 17 Mar 2024 16:57:19 +0100 Subject: [PATCH] tweaks: express an 'if' more concisely, and add two blank lines The calls of wnoutrefresh() after those new blank lines are not needed for ncurses to show the cursor in the right place, but are logically needed because things have been written to the screen in the preceding code -- although nano seems to work correctly also without those calls. --- src/prompt.c | 1 + src/winio.c | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/prompt.c b/src/prompt.c index 9a91f714..d427d1ea 100644 --- a/src/prompt.c +++ b/src/prompt.c @@ -392,6 +392,7 @@ void draw_the_promptbar(void) /* Place the cursor at the right spot. */ wmove(footwin, 0, column - the_page); + wnoutrefresh(footwin); } diff --git a/src/winio.c b/src/winio.c index 04f399a6..dfca625d 100644 --- a/src/winio.c +++ b/src/winio.c @@ -3420,10 +3420,7 @@ void edit_refresh(void) line = openfile->edittop; while (row < editwinrows && line != NULL) { - if (line == openfile->current) - row += update_line(line, openfile->current_x); - else - row += update_line(line, 0); + row += update_line(line, (line == openfile->current) ? openfile->current_x : 0); line = line->next; } @@ -3441,6 +3438,7 @@ void edit_refresh(void) #endif place_the_cursor(); + wnoutrefresh(midwin); refresh_needed = FALSE;