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)

6f2465d336

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
zeertzjq
2023-09-23 12:41:09 +08:00
committed by GitHub
parent c26b39a9aa
commit c88bb658ce
3 changed files with 27 additions and 10 deletions

View File

@@ -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.