fix(api): don't use 'winborder' when reconfiguring float (#32984)

Problem: Reconfiguring a float window applies the global 'winborder'.
Solution:
- Ignore 'winborder' when reconfiguring a float window.
- Still apply 'winborder' when converting a split to a float window.
This commit is contained in:
glepnir
2025-03-19 20:16:20 +08:00
committed by GitHub
parent 74fcc9452c
commit 0e59f6f4c7
3 changed files with 39 additions and 2 deletions

View File

@ -10088,7 +10088,7 @@ describe('float window', function()
-- respect config.border
command('set winborder=rounded')
config.border = 'single'
api.nvim_open_win(buf, false, config)
local winid = api.nvim_open_win(buf, false, config)
if multigrid then
screen:expect({
grid = [[
@ -10153,6 +10153,11 @@ describe('float window', function()
]])
end
-- don't use winborder when reconfig a floating window
config.border = nil
api.nvim_win_set_config(winid, config)
screen:expect_unchanged()
command('fclose!')
-- it is currently not supported.
eq('Vim(set):E474: Invalid argument: winborder=custom', pcall_err(command, 'set winborder=custom'))
end)