fix(api): don't config split as floatwin relative to itself

Problem: possible to configure a split as a floatwin with relative=win that is
relative to itself.

Solution: fix the check.

Not caused by this PR; just something I noticed when about to fix the validation
logic.
This commit is contained in:
Sean Dewar
2026-03-11 09:46:28 +00:00
parent c924c2a7b3
commit ef084b5c22
2 changed files with 4 additions and 1 deletions

View File

@@ -11191,6 +11191,9 @@ describe('float window', function()
local winid = api.nvim_open_win(buf, false, config)
api.nvim_set_current_win(winid)
eq('floating window cannot be relative to itself', pcall_err(api.nvim_win_set_config, winid, config))
-- Also when configuring split into float.
command('split')
eq('floating window cannot be relative to itself', pcall_err(api.nvim_win_set_config, 0, config))
end)
it('bufpos out of range', function()