display: do not try to draw content when there is no open buffer yet

Commit b63c90bf avoided creating an empty buffer before asking the
yes-no question when encountering a lock file at startup, but the
SIGWINCH code still expected to have an open buffer whose contents
to show.

This fix also has the pleasant effect that, when resizing the screen
at the lock-file yes-no prompt, the title bar doesn't suddenly appear.

This fixes https://savannah.gnu.org/bugs/?58414.
Reported-by: Liu Hao <lh_mouse@126.com>

Bug existed since version 4.9, commit b63c90bf.
This commit is contained in:
Benno Schulenberg 2020-05-21 09:12:33 +02:00
parent 747ce3b5da
commit c9482bcd2b

View File

@ -1039,18 +1039,20 @@ void regenerate_screen(void)
#endif
editwincols = COLS - margin;
/* Ensure that firstcolumn is the starting column of its chunk. */
ensure_firstcolumn_is_aligned();
/* Do as the website suggests: leave and immediately reenter curses mode. */
endwin();
doupdate();
/* Put the terminal in the desired state again, recreate the subwindows
* with their (new) sizes, and redraw the contents of these windows. */
/* Put the terminal in the desired state again, and
* recreate the subwindows with their (new) sizes. */
terminal_init();
window_init();
total_refresh();
/* If we have an open buffer, redraw the contents of the subwindows. */
if (openfile) {
ensure_firstcolumn_is_aligned();
total_refresh();
}
}
/* Handle the global toggle specified in flag. */