diff options
author | Ghjuvan Lacambre <code@lacamb.re> | 2021-06-26 16:18:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-26 10:18:36 -0400 |
commit | ad9c2c069a96b694956fcae3614c637aeb5fa6fe (patch) | |
tree | 2ab90404fbec686663dfe9c98737e628e40b5335 /test/functional/autocmd/autocmd_spec.lua | |
parent | c1120ad0e1adf8b34ee10b63b2134fcb0d580fce (diff) | |
download | rneovim-ad9c2c069a96b694956fcae3614c637aeb5fa6fe.tar.gz rneovim-ad9c2c069a96b694956fcae3614c637aeb5fa6fe.tar.bz2 rneovim-ad9c2c069a96b694956fcae3614c637aeb5fa6fe.zip |
Fix `<afile>` getting prepended with a slash on WinClosed (#14515)
It is wrong to assume that you can't shorten a path if it's in `/`: you
can always shorten it by removing the forward slash.
Closes #14512
Diffstat (limited to 'test/functional/autocmd/autocmd_spec.lua')
-rw-r--r-- | test/functional/autocmd/autocmd_spec.lua | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/functional/autocmd/autocmd_spec.lua b/test/functional/autocmd/autocmd_spec.lua index e62d3bb66b..93d71a9e45 100644 --- a/test/functional/autocmd/autocmd_spec.lua +++ b/test/functional/autocmd/autocmd_spec.lua @@ -101,6 +101,17 @@ describe('autocmd', function() }, eval('g:evs')) end) + it('WinClosed from root directory', function() + command('cd /') + command('let g:evs = []') + command('autocmd WinClosed * :call add(g:evs, ["WinClosed", expand("<afile>")])') + command('new') + command('close') + eq({ + {'WinClosed', '1001'}, + }, eval('g:evs')) + end) + it('v:vim_did_enter is 1 after VimEnter', function() eq(1, eval('v:vim_did_enter')) end) |