nano

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

commit fe0b928b39af994f2dfec0269cafc9bb15911155
parent 4b1a81e7734fa7281c45c4df36c75f6f0fb69296
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Tue, 30 Jul 2024 17:10:30 +0200

tweaks: move a condition to the only place that needs it

Most calls of draw_all_subwindows() are made while in the edit window.
The only call that could occur while in the file browser is the one in
regenerate_screen().  So only this call needs to be guarded against
being made while the file list is being shown.

Diffstat:
Msrc/nano.c | 3++-
Msrc/winio.c | 8+++-----
2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/nano.c b/src/nano.c @@ -1075,7 +1075,8 @@ void regenerate_screen(void) /* If we have an open buffer, redraw the contents of the subwindows. */ if (openfile) { ensure_firstcolumn_is_aligned(); - draw_all_subwindows(); + if (currmenu & ~(MBROWSER|MWHEREISFILE|MGOTODIR)) + draw_all_subwindows(); } } diff --git a/src/winio.c b/src/winio.c @@ -3478,19 +3478,17 @@ void full_refresh(void) wrefresh(curscr); } -/* Draw all elements of the screen. That is: the title bar plus the content - * of the edit window (when not in the file browser), and the bottom bars. */ +/* Draw the three elements of the screen: the title bar, + * the contents of the edit window, and the bottom bars. */ void draw_all_subwindows(void) { - if (currmenu & ~(MBROWSER|MWHEREISFILE|MGOTODIR)) - titlebar(title); + titlebar(title); #ifdef ENABLE_HELP if (inhelp) { close_buffer(); wrap_help_text_into_buffer(); } else #endif - if (currmenu & ~(MBROWSER|MWHEREISFILE|MGOTODIR)) edit_refresh(); bottombars(currmenu); }