mirror of
https://github.com/neovim/neovim.git
synced 2026-07-13 21:00:42 +00:00
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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user