From 9b10b4cc6463d901b893ad2d522c629d066607d5 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 20 Apr 2022 10:26:33 +0800 Subject: vim-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. https://github.com/vim/vim/commit/1417c766f55e5959b31da488417b7d9b141404af Expected error number was changed to E242 in Vim in patch 8.2.1183, and patch 8.2.2420 (which has already been ported) made the test no longer throw E249 in Vim, so just use E242 in the test. --- src/nvim/buffer.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/nvim/buffer.c') diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index 4d914acea4..78426568b4 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -4855,6 +4855,10 @@ void do_arg_all(int count, int forceit, int keep_tabs) if (keep_tabs) { new_curwin = wp; new_curtab = curtab; + } else if (wp->w_frame->fr_parent != curwin->w_frame->fr_parent) { + emsg(_("E249: window layout changed unexpectedly")); + i = count; + break; } else { win_move_after(wp, curwin); } -- cgit