aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-09-23 08:02:12 +0800
committerGitHub <noreply@github.com>2022-09-23 08:02:12 +0800
commit9aead1f670f42bac754709215fbab32397a202b0 (patch)
tree6fca35b20fd84ce30df1df89bb442239711b0620 /src/nvim/testdir
parent0760379b413ca95b80ed2970b49f14ba3b1acbf9 (diff)
parentd7052e8e1f0311113199ae5c25886fa9690367e4 (diff)
downloadrneovim-9aead1f670f42bac754709215fbab32397a202b0.tar.gz
rneovim-9aead1f670f42bac754709215fbab32397a202b0.tar.bz2
rneovim-9aead1f670f42bac754709215fbab32397a202b0.zip
Merge pull request #20299 from zeertzjq/vim-9.0.0550
vim-patch:9.0.0550: crash when closing a tabpage and buffer is NULL
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_autocmd.vim20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_autocmd.vim b/src/nvim/testdir/test_autocmd.vim
index 1be2d11034..d766256d4b 100644
--- a/src/nvim/testdir/test_autocmd.vim
+++ b/src/nvim/testdir/test_autocmd.vim
@@ -447,6 +447,26 @@ func Test_WinClosed_throws_with_tabs()
augroup! test-WinClosed
endfunc
+" This used to trigger WinClosed twice for the same window, and the window's
+" buffer was NULL in the second autocommand.
+func Test_WinClosed_switch_tab()
+ edit Xa
+ split Xb
+ split Xc
+ tab split
+ new
+ augroup test-WinClosed
+ autocmd WinClosed * tabprev | bwipe!
+ augroup END
+ close
+ " Check that the tabline has been fully removed
+ call assert_equal([1, 1], win_screenpos(0))
+
+ autocmd! test-WinClosed
+ augroup! test-WinClosed
+ %bwipe!
+endfunc
+
func s:AddAnAutocmd()
augroup vimBarTest
au BufReadCmd * echo 'hello'