From 888cdce3aa70c5800916b0d54ab40e8ac01d704a Mon Sep 17 00:00:00 2001 From: rover Date: Sat, 7 Jan 2017 22:56:51 +0800 Subject: vim-patch:7.4.2006 Problem: Crash when using tabnext in BufUnload autocmd. (Norio Takagi) Solution: First check that the current buffer is the right one. (Hirohito Higashi) https://github.com/vim/vim/commit/30445cb6e94698d212ba866ef3e4022ac625540a --- src/nvim/testdir/test_autocmd.vim | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_autocmd.vim b/src/nvim/testdir/test_autocmd.vim index 5675697dc4..8ead589871 100644 --- a/src/nvim/testdir/test_autocmd.vim +++ b/src/nvim/testdir/test_autocmd.vim @@ -64,6 +64,24 @@ function Test_bufunload() augroup! test_bufunload_group endfunc +" SEGV occurs in older versions. (At least 7.4.2005 or older) +function Test_autocmd_bufunload_with_tabnext() + tabedit + tabfirst + + augroup test_autocmd_bufunload_with_tabnext_group + autocmd! + autocmd BufUnload tabnext + augroup END + + quit + call assert_equal(2, tabpagenr('$')) + + augroup! test_autocmd_bufunload_with_tabnext_group + tablast + quit +endfunc + func s:AddAnAutocmd() augroup vimBarTest au BufReadCmd * echo 'hello' -- cgit