diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-09-12 17:45:33 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-12 17:45:33 -0700 |
commit | 3855204f5860ff2a66133541ff7593f0c2606a75 (patch) | |
tree | c028665f67fc7b9f9d8b576fa8c46157245016d3 /test/functional/api/ui_spec.lua | |
parent | 426399c2c4dd325bf00ffe1f410c1b9fd5053692 (diff) | |
parent | 492ac04f7e0ffcc5011d3604b234d149f8b0bb91 (diff) | |
download | rneovim-3855204f5860ff2a66133541ff7593f0c2606a75.tar.gz rneovim-3855204f5860ff2a66133541ff7593f0c2606a75.tar.bz2 rneovim-3855204f5860ff2a66133541ff7593f0c2606a75.zip |
Merge #6917 'UIEnter, UILeave'
Diffstat (limited to 'test/functional/api/ui_spec.lua')
-rw-r--r-- | test/functional/api/ui_spec.lua | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/functional/api/ui_spec.lua b/test/functional/api/ui_spec.lua index 2758da6a1f..279cd1856d 100644 --- a/test/functional/api/ui_spec.lua +++ b/test/functional/api/ui_spec.lua @@ -35,3 +35,24 @@ describe('nvim_ui_attach()', function() pcall_err(request, 'nvim_ui_attach', 40, 10, { rgb=false })) end) end) + +it('autocmds UIEnter/UILeave', function() + clear{ + args_rm={'--headless'}, + args={ + '--cmd', 'let g:evs = []', + '--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:uienter_ev')) + screen:detach() + eq({chan=1}, eval('g:uileave_ev')) + eq({ + 'VimEnter', + 'UIEnter', + 'UILeave', + }, eval('g:evs')) +end) |