Mercurial > vim
comparison src/testdir/test_autocmd.vim @ 9595:0190d5de215f v7.4.2075
commit https://github.com/vim/vim/commit/c917da4b3e8801a255dbefea8e4ed19c1c716dd8
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Jul 19 22:31:36 2016 +0200
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)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 19 Jul 2016 22:45:05 +0200 |
parents | 073aebdba121 |
children | 42a8a81decdf |
comparison
equal
deleted
inserted
replaced
9594:054a7764b8ea | 9595:0190d5de215f |
---|---|
76 | 76 |
77 augroup! test_autocmd_bufunload_with_tabnext_group | 77 augroup! test_autocmd_bufunload_with_tabnext_group |
78 tablast | 78 tablast |
79 quit | 79 quit |
80 endfunc | 80 endfunc |
81 | |
82 func Test_win_tab_autocmd() | |
83 let g:record = [] | |
84 | |
85 augroup testing | |
86 au WinNew * call add(g:record, 'WinNew') | |
87 au WinEnter * call add(g:record, 'WinEnter') | |
88 au WinLeave * call add(g:record, 'WinLeave') | |
89 au TabNew * call add(g:record, 'TabNew') | |
90 au TabEnter * call add(g:record, 'TabEnter') | |
91 au TabLeave * call add(g:record, 'TabLeave') | |
92 augroup END | |
93 | |
94 split | |
95 tabnew | |
96 close | |
97 close | |
98 | |
99 call assert_equal([ | |
100 \ 'WinLeave', 'WinNew', 'WinEnter', | |
101 \ 'WinLeave', 'TabLeave', 'WinNew', 'WinEnter', 'TabNew', 'TabEnter', | |
102 \ 'WinLeave', 'TabLeave', 'WinEnter', 'TabEnter', | |
103 \ 'WinLeave', 'WinEnter' | |
104 \ ], g:record) | |
105 | |
106 augroup testing | |
107 au! | |
108 augroup END | |
109 unlet g:record | |
110 endfunc |