mirror of
https://github.com/neovim/neovim.git
synced 2026-03-31 04:42:03 +00:00
vim-patch:9.1.0117: Stop split-moving from firing WinNew and WinNewPre autocommands
Problem: win_splitmove fires WinNewPre and possibly WinNew when moving
windows, even though no new windows are created.
Solution: don't fire WinNew and WinNewPre when inserting an existing
window, even if it isn't the current window. Improve the
accuracy of related documentation. (Sean Dewar)
related: vim/vim#14038
96cc4aef3d
Most of the patch was already ported. This includes the remaining part.
Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
This commit is contained in:
@@ -1127,7 +1127,9 @@ win_T *win_split_ins(int size, int flags, win_T *new_wp, int dir, frame_T *to_fl
|
||||
return NULL;
|
||||
}
|
||||
|
||||
trigger_winnewpre();
|
||||
if (new_wp == NULL) {
|
||||
trigger_winnewpre();
|
||||
}
|
||||
|
||||
win_T *oldwin;
|
||||
if (flags & WSP_TOP) {
|
||||
|
||||
@@ -1043,8 +1043,7 @@ func Test_win_splitmove()
|
||||
let s:triggered = []
|
||||
augroup WinSplitMove
|
||||
au!
|
||||
" Nvim: WinNewPre not ported yet. Also needs full port of v9.1.0117 to pass.
|
||||
" au WinNewPre * let s:triggered += ['WinNewPre']
|
||||
au WinNewPre * let s:triggered += ['WinNewPre']
|
||||
au WinNew * let s:triggered += ['WinNew', win_getid()]
|
||||
au WinClosed * let s:triggered += ['WinClosed', str2nr(expand('<afile>'))]
|
||||
augroup END
|
||||
|
||||
Reference in New Issue
Block a user