From c88bb658ce6fb12cca3e5324d8a15d1859d095cd Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 23 Sep 2023 12:41:09 +0800 Subject: vim-patch:8.2.4609: :unhide does not check for failing to close a window (#25317) Problem: :unhide does not check for failing to close a window. Solution: When closing a window fails continue with the next one. Do not try closing the autocmd window. (closes vim/vim#9984) https://github.com/vim/vim/commit/6f2465d336a9d4afe392db4084ef7e9db17e67c1 Co-authored-by: Bram Moolenaar --- test/old/testdir/test_autocmd.vim | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test') diff --git a/test/old/testdir/test_autocmd.vim b/test/old/testdir/test_autocmd.vim index 0afa3417ec..9da20e662e 100644 --- a/test/old/testdir/test_autocmd.vim +++ b/test/old/testdir/test_autocmd.vim @@ -4,6 +4,7 @@ source shared.vim source check.vim source term_util.vim source screendump.vim +source vim9.vim source load.vim func s:cleanup_buffers() abort @@ -3432,6 +3433,20 @@ func Test_autocmd_vimgrep() augroup END endfunc +func Test_closing_autocmd_window() + let lines =<< trim END + edit Xa.txt + tabnew Xb.txt + autocmd BufEnter Xa.txt unhide 1 + doautoall BufEnter + END + call CheckScriptFailure(lines, 'E814:') + au! BufEnter + only! + bwipe Xa.txt + bwipe Xb.txt +endfunc + func Test_bufwipeout_changes_window() " This should not crash, but we don't have any expectations about what " happens, changing window in BufWipeout has unpredictable results. -- cgit