From fe0b928b39af994f2dfec0269cafc9bb15911155 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Tue, 30 Jul 2024 17:10:30 +0200 Subject: [PATCH] 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. --- src/nano.c | 3 ++- src/winio.c | 8 +++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/nano.c b/src/nano.c index 599f005e..f4dbfdd1 100644 --- 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 index 90c32b44..d4625994 100644 --- 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); }