diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-01-15 16:22:52 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-01-15 16:22:52 +0100 |
commit | 797e63b9f2baa1853e7063aac478d663cd02f207 (patch) | |
tree | 9fa8b1f0922ac19e98e0db47736c5e8107801317 /src/testdir/test_autocmd.vim | |
parent | 17d015b2438e51d4d42d72720611d16c772cc4bb (diff) | |
download | vim-git-797e63b9f2baa1853e7063aac478d663cd02f207.tar.gz |
patch 8.2.2354: crash with a weird combination of autocommandsv8.2.2354
Problem: Crash with a weird combination of autocommands.
Solution: Increment b_nwindows when needed. (closes #7674)
Diffstat (limited to 'src/testdir/test_autocmd.vim')
-rw-r--r-- | src/testdir/test_autocmd.vim | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim index 97b091466..0d6b414e6 100644 --- a/src/testdir/test_autocmd.vim +++ b/src/testdir/test_autocmd.vim @@ -500,6 +500,26 @@ 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 delete('XblastBall') + call delete('Xerrors') +endfunc + " SEGV occurs in older versions. func Test_autocmd_bufwipe_in_SessLoadPost2() tabnew |