diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-03-10 08:37:16 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-10 08:37:16 +0800 |
commit | 9bd4a2807960ea3e82b0454861b399f4ac6d8a92 (patch) | |
tree | 68fd7c2f008a70c449a5c130a9b98d44de407fe6 /test | |
parent | 731e7f51ee40778b5baeec99aaf1d551b0855667 (diff) | |
download | rneovim-9bd4a2807960ea3e82b0454861b399f4ac6d8a92.tar.gz rneovim-9bd4a2807960ea3e82b0454861b399f4ac6d8a92.tar.bz2 rneovim-9bd4a2807960ea3e82b0454861b399f4ac6d8a92.zip |
fix(window): :close crash if WinClosed from float closes window (#27794)
Problem: :close crash if WinClosed from float closes window.
Solution: Check if window has already been closed.
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/ui/float_spec.lua | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua index 50b4b3b073..6bc3fd14ec 100644 --- a/test/functional/ui/float_spec.lua +++ b/test/functional/ui/float_spec.lua @@ -908,6 +908,21 @@ describe('float window', function() command('close') assert_alive() end) + + it('does not crash if WinClosed from floating windows closes it', function() + exec([[ + tabnew + let g:buf = bufnr() + new + let s:win = win_getid() + call nvim_win_set_config(s:win, + \ #{relative: 'editor', row: 5, col: 5, width: 5, height: 5}) + wincmd t + exe $"autocmd WinClosed {s:win} 1close" + ]]) + command('close') + assert_alive() + end) end) local function with_ext_multigrid(multigrid) |