diff options
author | luukvbaal <luukvbaal@gmail.com> | 2025-04-01 14:02:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-01 05:02:24 -0700 |
commit | 0e7479bb7637a21121b990cc960262a0d60196da (patch) | |
tree | 12803bbc13c6726677ea31b98e8363666c00284e /test | |
parent | ec6670080a71835a54e28a0f5489b0fad5f4e531 (diff) | |
download | rneovim-0e7479bb7637a21121b990cc960262a0d60196da.tar.gz rneovim-0e7479bb7637a21121b990cc960262a0d60196da.tar.bz2 rneovim-0e7479bb7637a21121b990cc960262a0d60196da.zip |
fix(window): crash on negative window height with 'winbar' #33250
Problem: Negative window and grid height with 'winbar'.
Solution: Clamp the height when subtracting the 'winbar' height.
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/ui/winbar_spec.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/functional/ui/winbar_spec.lua b/test/functional/ui/winbar_spec.lua index d1fd273dc1..09338eb7d2 100644 --- a/test/functional/ui/winbar_spec.lua +++ b/test/functional/ui/winbar_spec.lua @@ -540,6 +540,15 @@ describe('winbar', function() ]]) eq('Vim(set):E36: Not enough room', pcall_err(command, 'set winbar=test')) end) + + it('does not crash due to negative grid height #33176', function() + screen:try_resize(screen._width, 20) + command('botright split | belowright vsplit | 2wincmd w') + api.nvim_set_option_value('winfixheight', true, { scope = 'local', win = 0 }) + api.nvim_win_set_height(0, 8) + feed('q:') + n.assert_alive() + end) end) describe('local winbar with tabs', function() |