patch 8.1.1756: autocommand that splits window messes up window layout
Problem: Autocommand that splits window messes up window layout.
Solution: Disallow splitting a window while closing one. In ":all" give an
error when moving a window will not work.
diff --git a/src/buffer.c b/src/buffer.c
index 55bcc82..4e60751 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -5101,6 +5101,13 @@
new_curwin = wpnext;
new_curtab = curtab;
}
+ else if (wpnext->w_frame->fr_parent
+ != curwin->w_frame->fr_parent)
+ {
+ emsg(_("E249: window layout changed unexpectedly"));
+ i = count;
+ break;
+ }
else
win_move_after(wpnext, curwin);
break;