diff options
author | notomo <notomo.motono@gmail.com> | 2020-01-14 22:34:05 +0900 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2020-01-18 17:06:03 -0800 |
commit | 2b8e66c6ce0a5ccae09023732c06da90f96ed5f5 (patch) | |
tree | c55c4b887cd8be295bf9bfda233b934f78ba8816 /test | |
parent | 757aad92e84709a08320a06870b6acb086bc6876 (diff) | |
download | rneovim-2b8e66c6ce0a5ccae09023732c06da90f96ed5f5.tar.gz rneovim-2b8e66c6ce0a5ccae09023732c06da90f96ed5f5.tar.bz2 rneovim-2b8e66c6ce0a5ccae09023732c06da90f96ed5f5.zip |
autocmd: WinClosed exposes window id as <afile>
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/autocmd/autocmd_spec.lua | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/functional/autocmd/autocmd_spec.lua b/test/functional/autocmd/autocmd_spec.lua index 31c6edb940..6cb12750a1 100644 --- a/test/functional/autocmd/autocmd_spec.lua +++ b/test/functional/autocmd/autocmd_spec.lua @@ -50,6 +50,13 @@ describe('autocmd', function() eq(1, eval('g:triggered')) end) + it('WinClosed event exposes window id as <afile>', function() + command('new') + local id = meths.get_current_win().id + helpers.nvim('command', 'au! WinClosed * echom "winclosed:".expand("<afile>").":".expand("<amatch>").":".win_getid()') + eq(string.format("winclosed:%s:%s:%s", id, id, id), helpers.nvim('exec', 'close', true)) + end) + it(':bdelete triggers WinClosed event', function() command('let g:triggered = 0') command('autocmd WinClosed <buffer> :let g:triggered+=1') |