From fa15f2f9380433b4d22387ce313bd4735b960c4e Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 20 Apr 2022 09:18:39 +0800 Subject: vim-patch:8.2.2472: crash when using command line window in an autocommand Problem: Crash when using command line window in an autocommand. (houyunsong) Solution: Save and restore au_new_curbuf. https://github.com/vim/vim/commit/aad5f9d79a2b71e9d2581eace3652be156102b9d Nvim has removed :open, so use :edit in the test instead. --- src/nvim/testdir/test_autocmd.vim | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_autocmd.vim b/src/nvim/testdir/test_autocmd.vim index 228145ec4d..7ad3c8c6ad 100644 --- a/src/nvim/testdir/test_autocmd.vim +++ b/src/nvim/testdir/test_autocmd.vim @@ -2695,9 +2695,9 @@ func Test_autocmd_closes_window() au BufNew,BufWinLeave * e %e file yyy au BufNew,BufWinLeave * ball - call assert_fails('n xxx', 'E143:') + n xxx - bwipe % + %bwipe au! BufNew au! BufWinLeave endfunc @@ -2715,6 +2715,23 @@ func Test_autocmd_quit_psearch() augroup END endfunc +" Fuzzer found some strange combination that caused a crash. +func Test_autocmd_normal_mess() + augroup aucmd_normal_test + au BufLeave,BufWinLeave,BufHidden,BufUnload,BufDelete,BufWipeout * norm 7q/qc + augroup END + " Nvim has removed :open + " o4 + e4 + silent! H + e xx + normal G + + augroup aucmd_normal_test + au! + augroup END +endfunc + func Test_autocmd_closing_cmdwin() au BufWinLeave * nested q call assert_fails("norm 7q?\n", 'E855:') -- cgit