aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_autocmd.vim
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/testdir/test_autocmd.vim')
-rw-r--r--src/nvim/testdir/test_autocmd.vim21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_autocmd.vim b/src/nvim/testdir/test_autocmd.vim
index 4b575bdfc3..1936832400 100644
--- a/src/nvim/testdir/test_autocmd.vim
+++ b/src/nvim/testdir/test_autocmd.vim
@@ -2669,6 +2669,27 @@ func Test_autocmd_window()
%bw!
endfunc
+" Test for trying to close the temporary window used for executing an autocmd
+func Test_close_autocmd_window()
+ %bw!
+ edit one.txt
+ tabnew two.txt
+ augroup aucmd_win_test2
+ au!
+ " Nvim makes aucmd_win the last window
+ " au BufEnter * if expand('<afile>') == 'one.txt' | 1close | endif
+ au BufEnter * if expand('<afile>') == 'one.txt' | close | endif
+ augroup END
+
+ call assert_fails('doautoall BufEnter', 'E813:')
+
+ augroup aucmd_win_test2
+ au!
+ augroup END
+ augroup! aucmd_win_test2
+ %bw!
+endfunc
+
" Test for trying to close the tab that has the temporary window for exeucing
" an autocmd.
func Test_close_autocmd_tab()