nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 170e7d79e7777b51b4e3217769e9307713229d49
parent a7635ceb5dc4cc39b29a65f0bafe7d078a65b6c1
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Sun, 17 Mar 2024 16:57:19 +0100

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.

Diffstat:
Msrc/prompt.c | 1+
Msrc/winio.c | 6++----
2 files changed, 3 insertions(+), 4 deletions(-)

diff --git 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 @@ -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;