fix(float): validate conflicts for nvim_win_set_config()

Problem:  nvim_win_set_config() does not error on flags not allowed for
          non-floating windows.
          `hide` should not be allowed for non-floating windows.
Solution: Check that a window is a split when reconfiguring.
          Error when trying to hide a split window.
This commit is contained in:
Luuk van Baal
2026-05-31 15:48:58 +02:00
parent 1ca65faca6
commit 9cf684ed7d
2 changed files with 19 additions and 8 deletions

View File

@@ -205,6 +205,13 @@ describe('float window', function()
"Conflict: 'bufpos' not allowed with non-float window",
pcall_err(api.nvim_win_set_config, winid, { split = 'right', bufpos = { 0, 0 } })
)
-- Reconfiguring split
local not_allowed = { hide = true, zindex = 1, title = '', footer = '', border = 'single' }
for k, v in pairs(not_allowed) do
local err = ("Conflict: '%s' not allowed with non-float window"):format(k)
eq(err, pcall_err(api.nvim_win_set_config, winid, { [k] = v }))
end
end)
it('win_execute() should work', function()