mirror of
git://git.sv.gnu.org/nano.git
synced 2025-01-24 18:22:07 +03:00
display: do not try to draw content when there is no open buffer yet
Commitb63c90bf
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, commitb63c90bf
.
This commit is contained in:
parent
747ce3b5da
commit
c9482bcd2b
14
src/nano.c
14
src/nano.c
@ -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. */
|
||||
|
Loading…
Reference in New Issue
Block a user