summaryrefslogtreecommitdiff
path: root/src/testdir/test_autocmd.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-07-19 23:13:03 +0200
committerBram Moolenaar <Bram@vim.org>2016-07-19 23:13:03 +0200
commit12c11d553053f5a9eae9eb3c518279b12fa928c2 (patch)
tree9516b5c3300a1799e1a5657457dedd7e8d526749 /src/testdir/test_autocmd.vim
parent4f0383bc3fe5af0229fb66b53fe94329af783eff (diff)
downloadvim-12c11d553053f5a9eae9eb3c518279b12fa928c2.zip
patch 7.4.2077
Problem: Cannot update 'tabline' when a tab was closed. Solution: Add the TabClosed autocmd event. (partly by Felipe Morales)
Diffstat (limited to 'src/testdir/test_autocmd.vim')
-rw-r--r--src/testdir/test_autocmd.vim14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim
index 14254a7fa..580c42fe4 100644
--- a/src/testdir/test_autocmd.vim
+++ b/src/testdir/test_autocmd.vim
@@ -87,6 +87,7 @@ func Test_win_tab_autocmd()
au WinEnter * call add(g:record, 'WinEnter')
au WinLeave * call add(g:record, 'WinLeave')
au TabNew * call add(g:record, 'TabNew')
+ au TabClosed * call add(g:record, 'TabClosed')
au TabEnter * call add(g:record, 'TabEnter')
au TabLeave * call add(g:record, 'TabLeave')
augroup END
@@ -99,10 +100,21 @@ func Test_win_tab_autocmd()
call assert_equal([
\ 'WinLeave', 'WinNew', 'WinEnter',
\ 'WinLeave', 'TabLeave', 'WinNew', 'WinEnter', 'TabNew', 'TabEnter',
- \ 'WinLeave', 'TabLeave', 'WinEnter', 'TabEnter',
+ \ 'WinLeave', 'TabLeave', 'TabClosed', 'WinEnter', 'TabEnter',
\ 'WinLeave', 'WinEnter'
\ ], g:record)
+ let g:record = []
+ tabnew somefile
+ tabnext
+ bwipe somefile
+
+ call assert_equal([
+ \ 'WinLeave', 'TabLeave', 'WinNew', 'WinEnter', 'TabNew', 'TabEnter',
+ \ 'WinLeave', 'TabLeave', 'WinEnter', 'TabEnter',
+ \ 'TabClosed'
+ \ ], g:record)
+
augroup testing
au!
augroup END