mirror of
https://github.com/neovim/neovim.git
synced 2025-12-15 19:05:40 +00:00
vim-patch:9.1.1916: WinEnter autocommand confuses Vim when closing tabpage (#36567)
Problem: WinEnter autocommand may confuse Vim when closing tabpage
(hokorobi)
Solution: Verify that curwin did not change in close_others()
fixes: vim/vim#18722
closes: vim/vim#18733
61b73b89a3
Co-authored-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
@@ -4603,4 +4603,27 @@ func Test_eventignore_subtract()
|
||||
%bw!
|
||||
endfunc
|
||||
|
||||
func Test_win_tabclose_autocmd()
|
||||
|
||||
defer CleanUpTestAuGroup()
|
||||
new
|
||||
augroup testing
|
||||
au WinClosed * wincmd p
|
||||
augroup END
|
||||
|
||||
tabnew
|
||||
new
|
||||
new
|
||||
|
||||
call assert_equal(2, tabpagenr('$'))
|
||||
try
|
||||
tabclose
|
||||
catch
|
||||
" should not happen
|
||||
call assert_report("closing tabpage failed")
|
||||
endtry
|
||||
call assert_equal(1, tabpagenr('$'))
|
||||
bw!
|
||||
endfunc
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
||||
Reference in New Issue
Block a user