aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-05-11 22:17:12 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-05-13 20:47:26 -0400
commitf98433d82a340008fdc51c2093e74400e71101dc (patch)
tree7b381a5f7eb4243226c97655af05e36dc09ef97b /src/nvim/testdir
parent433807763236427cbe0ff347c1c5b77877aa0aff (diff)
downloadrneovim-f98433d82a340008fdc51c2093e74400e71101dc.tar.gz
rneovim-f98433d82a340008fdc51c2093e74400e71101dc.tar.bz2
rneovim-f98433d82a340008fdc51c2093e74400e71101dc.zip
vim-patch:8.2.2354: crash with a weird combination of autocommands
Problem: Crash with a weird combination of autocommands. Solution: Increment b_nwindows when needed. (closes vim/vim#7674) https://github.com/vim/vim/commit/797e63b9f2baa1853e7063aac478d663cd02f207
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_autocmd.vim21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_autocmd.vim b/src/nvim/testdir/test_autocmd.vim
index fb3aa2b3b0..a2aa1c32c5 100644
--- a/src/nvim/testdir/test_autocmd.vim
+++ b/src/nvim/testdir/test_autocmd.vim
@@ -452,6 +452,27 @@ func Test_autocmd_bufwipe_in_SessLoadPost()
endfor
endfunc
+" Using :blast and :ball for many events caused a crash, because b_nwindows was
+" not incremented correctly.
+func Test_autocmd_blast_badd()
+ let content =<< trim [CODE]
+ au BufNew,BufAdd,BufWinEnter,BufEnter,BufLeave,BufWinLeave,BufUnload,VimEnter foo* blast
+ edit foo1
+ au BufNew,BufAdd,BufWinEnter,BufEnter,BufLeave,BufWinLeave,BufUnload,VimEnter foo* ball
+ edit foo2
+ call writefile(['OK'], 'Xerrors')
+ qall
+ [CODE]
+
+ call writefile(content, 'XblastBall')
+ call system(GetVimCommand() .. ' --clean -S XblastBall')
+ " call assert_match('OK', readfile('Xerrors')->join())
+ call assert_match('OK', join(readfile('Xerrors')))
+
+ call delete('XblastBall')
+ call delete('Xerrors')
+endfunc
+
" SEGV occurs in older versions.
func Test_autocmd_bufwipe_in_SessLoadPost2()
tabnew