fix(window): don't store invalid height in window config (#34885)

Problem:  When 'winminheight' is zero and the window height is set to
          zero, the actual height is clamped whereas the stored config
          value is not. Reciprocal window configuration through
          nvim_win_get_config() then results in an error.
Solution: Also clamp the stored dimensions in the window config.
This commit is contained in:
luukvbaal
2025-07-11 18:53:30 +02:00
committed by GitHub
parent 9e968635ef
commit 7f5b5d34cf
3 changed files with 10 additions and 3 deletions

View File

@@ -923,6 +923,13 @@ describe('float window', function()
assert_alive()
end)
it("no error for zero height with 'winminheight'", function()
local win = api.nvim_open_win(0, false, { relative = 'editor', row = 0, col = 0, height = 1, width = 1 })
api.nvim_set_option_value('winminheight', 0, {})
api.nvim_win_set_height(win, 0)
api.nvim_win_set_config(win, api.nvim_win_get_config(win))
end)
local function with_ext_multigrid(multigrid)
local screen, attrs
before_each(function()