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/testdir/test_window_cmd.vim b/src/testdir/test_window_cmd.vim
index 4585cd3..7af7d07 100644
--- a/src/testdir/test_window_cmd.vim
+++ b/src/testdir/test_window_cmd.vim
@@ -531,14 +531,15 @@
endfunc
func Test_access_freed_mem()
+ call assert_equal(&columns, winwidth(0))
" This was accessing freed memory
au * 0 vs xxx
arg 0
argadd
- all
- all
+ call assert_fails("all", "E249:")
au!
bwipe xxx
+ call assert_equal(&columns, winwidth(0))
endfunc
func Test_visual_cleared_after_window_split()