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.
This commit is contained in:
Benno Schulenberg 2024-07-30 17:10:30 +02:00
parent 4b1a81e773
commit fe0b928b39
2 changed files with 5 additions and 6 deletions

View File

@ -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();
}
}

View File

@ -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);
}