aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_autocmd.vim
diff options
context:
space:
mode:
authorrover <pathfinder2013@126.com>2017-01-08 21:05:41 +0800
committerrover <pathfinder2013@126.com>2017-01-08 22:46:08 +0800
commitc2344f3d31fe6a006027dbf88873ee0916b73028 (patch)
tree00c08ee4d4a79beebe324e0da25c8caa1533d8b0 /src/nvim/testdir/test_autocmd.vim
parent888cdce3aa70c5800916b0d54ab40e8ac01d704a (diff)
downloadrneovim-c2344f3d31fe6a006027dbf88873ee0916b73028.tar.gz
rneovim-c2344f3d31fe6a006027dbf88873ee0916b73028.tar.bz2
rneovim-c2344f3d31fe6a006027dbf88873ee0916b73028.zip
vim-patch:7.4.2075
Problem: No autocommand event to initialize a window or tab page. Solution: Add WinNew and TabNew events. (partly by Felipe Morales) https://github.com/vim/vim/commit/c917da4b3e8801a255dbefea8e4ed19c1c716dd8
Diffstat (limited to 'src/nvim/testdir/test_autocmd.vim')
-rw-r--r--src/nvim/testdir/test_autocmd.vim30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_autocmd.vim b/src/nvim/testdir/test_autocmd.vim
index 8ead589871..5777ebcddc 100644
--- a/src/nvim/testdir/test_autocmd.vim
+++ b/src/nvim/testdir/test_autocmd.vim
@@ -82,6 +82,36 @@ function Test_autocmd_bufunload_with_tabnext()
quit
endfunc
+func Test_win_tab_autocmd()
+ let g:record = []
+
+ augroup testing
+ au WinNew * call add(g:record, 'WinNew')
+ au WinEnter * call add(g:record, 'WinEnter')
+ au WinLeave * call add(g:record, 'WinLeave')
+ au TabNew * call add(g:record, 'TabNew')
+ au TabEnter * call add(g:record, 'TabEnter')
+ au TabLeave * call add(g:record, 'TabLeave')
+ augroup END
+
+ split
+ tabnew
+ close
+ close
+
+ call assert_equal([
+ \ 'WinLeave', 'WinNew', 'WinEnter',
+ \ 'WinLeave', 'TabLeave', 'WinNew', 'WinEnter', 'TabNew', 'TabEnter',
+ \ 'WinLeave', 'TabLeave', 'WinEnter', 'TabEnter',
+ \ 'WinLeave', 'WinEnter'
+ \ ], g:record)
+
+ augroup testing
+ au!
+ augroup END
+ unlet g:record
+endfunc
+
func s:AddAnAutocmd()
augroup vimBarTest
au BufReadCmd * echo 'hello'