diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-03-21 21:19:09 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-03-23 09:07:21 +0800 |
commit | 89712dcbf8ecc41d6fab9608f684ce199667ed2e (patch) | |
tree | 721bbb33718fd95bc7e7a37f52f0d109fe453e09 /test/functional | |
parent | 7735163652cd9082ef89cb31707ca77df12f7b70 (diff) | |
download | rneovim-89712dcbf8ecc41d6fab9608f684ce199667ed2e.tar.gz rneovim-89712dcbf8ecc41d6fab9608f684ce199667ed2e.tar.bz2 rneovim-89712dcbf8ecc41d6fab9608f684ce199667ed2e.zip |
fix(aucmd_win): always make aucmd_win the last window
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/autocmd/autocmd_spec.lua | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/functional/autocmd/autocmd_spec.lua b/test/functional/autocmd/autocmd_spec.lua index f37f04b32f..c010fb8034 100644 --- a/test/functional/autocmd/autocmd_spec.lua +++ b/test/functional/autocmd/autocmd_spec.lua @@ -398,6 +398,25 @@ describe('autocmd', function() ]]) end) + describe('closing last non-floating window in tab from `aucmd_win`', function() + before_each(function() + command('edit Xa.txt') + command('tabnew Xb.txt') + command('autocmd BufAdd Xa.txt 1close') + end) + + it('gives E814 when there are no other floating windows', function() + eq('Vim(close):E814: Cannot close window, only autocmd window would remain', + pcall_err(command, 'doautoall BufAdd')) + end) + + it('gives E814 when there are other floating windows', function() + meths.open_win(0, true, {width = 10, height = 10, relative = 'editor', row = 10, col = 10}) + eq('Vim(close):E814: Cannot close window, only autocmd window would remain', + pcall_err(command, 'doautoall BufAdd')) + end) + end) + it(':doautocmd does not warn "No matching autocommands" #10689', function() local screen = Screen.new(32, 3) screen:attach() |