1
0
forked from aniani/vim

patch 8.2.1059: crash when using :tabonly in an autocommand

Problem:    Crash when using :tabonly in an autocommand. (Yegappan Lakshmanan)
Solution:   Do not allow the autocommand window to be closed.
This commit is contained in:
Bram Moolenaar
2020-06-26 19:44:06 +02:00
parent fc838d6cb0
commit cf8441704d
5 changed files with 32 additions and 2 deletions

View File

@@ -2617,7 +2617,27 @@ func Test_close_autocmd_window()
au!
augroup END
augroup! aucmd_win_test2
%bw!
%bwipe!
endfunc
" Test for trying to close the tab that has the temporary window for exeucing
" an autocmd.
func Test_close_autocmd_tab()
edit one.txt
tabnew two.txt
augroup aucmd_win_test
au!
au BufEnter * if expand('<afile>') == 'one.txt' | tabfirst | tabonly | endif
augroup END
call assert_fails('doautoall BufEnter', 'E813:')
tabonly
augroup aucmd_win_test
au!
augroup END
augroup! aucmd_win_test
%bwipe!
endfunc
" vim: shiftwidth=2 sts=2 expandtab