patch 8.1.1664: GUI resize may cause changing Rows at a bad time
Problem: GUI resize may cause changing Rows at a bad time. (Dominique
Pelle)
Solution: Postpone resizing while updating the screen.
diff --git a/src/term.c b/src/term.c
index afa622e..f1ccfcb 100644
--- a/src/term.c
+++ b/src/term.c
@@ -3425,11 +3425,15 @@
if (State == HITRETURN || State == SETWSIZE)
{
- /* postpone the resizing */
+ // postpone the resizing
State = SETWSIZE;
return;
}
+ if (updating_screen)
+ // resizing while in update_screen() may cause a crash
+ return;
+
/* curwin->w_buffer can be NULL when we are closing a window and the
* buffer has already been closed and removing a scrollbar causes a resize
* event. Don't resize then, it will happen after entering another buffer.