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,6 +1075,7 @@ void regenerate_screen(void)
/* If we have an open buffer, redraw the contents of the subwindows. */
if (openfile) {
ensure_firstcolumn_is_aligned();
if (currmenu & ~(MBROWSER|MWHEREISFILE|MGOTODIR))
draw_all_subwindows();
}
}

View File

@ -3478,11 +3478,10 @@ 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);
#ifdef ENABLE_HELP
if (inhelp) {
@ -3490,7 +3489,6 @@ void draw_all_subwindows(void)
wrap_help_text_into_buffer();
} else
#endif
if (currmenu & ~(MBROWSER|MWHEREISFILE|MGOTODIR))
edit_refresh();
bottombars(currmenu);
}