rename: UIAttach/UIDetach => UIEnter/UILeave

"enter"/"leave" is more conventional for Vim events, and
"attach"/"detach" distinction does not gain much.
This commit is contained in:
Justin M. Keyes
2019-09-12 16:08:22 -07:00
parent 44d45e29ea
commit 589f612adf
8 changed files with 26 additions and 26 deletions

View File

@@ -36,21 +36,21 @@ describe('nvim_ui_attach()', function()
end)
end)
it('autocmds UIAttach/UIDetach', function()
it('autocmds UIEnter/UILeave', function()
clear{args={
'--cmd', 'let g:evs = []',
'--cmd', 'autocmd UIAttach * :call add(g:evs, "UIAttach") | let g:ui_attach_ev = deepcopy(v:event)',
'--cmd', 'autocmd UIDetach * :call add(g:evs, "UIDetach") | let g:ui_detach_ev = deepcopy(v:event)',
'--cmd', 'autocmd UIEnter * :call add(g:evs, "UIEnter") | let g:uienter_ev = deepcopy(v:event)',
'--cmd', 'autocmd UILeave * :call add(g:evs, "UILeave") | let g:uileave_ev = deepcopy(v:event)',
'--cmd', 'autocmd VimEnter * :call add(g:evs, "VimEnter")',
}}
local screen = Screen.new()
screen:attach()
eq({chan=1}, eval('g:ui_attach_ev'))
eq({chan=1}, eval('g:uienter_ev'))
screen:detach()
eq({chan=1}, eval('g:ui_detach_ev'))
eq({chan=1}, eval('g:uileave_ev'))
eq({
'VimEnter',
'UIAttach',
'UIDetach',
'UIEnter',
'UILeave',
}, eval('g:evs'))
end)