fix(api): adjust fix for reconfiguring float "relative" (#34287)

Problem:  "win" is cleared in float config after 96330843, even with
          unchanged "relative".
Solution: Don't clear "win". Avoid erroring for deleted "win" by setting
          the parent win to curwin directly when "win" is zero or not
          present in config.
(cherry picked from commit eeacd7bd71)
This commit is contained in:
luukvbaal
2025-06-03 13:27:07 +02:00
committed by github-actions[bot]
parent 222b3d5021
commit aa6136f956
2 changed files with 9 additions and 6 deletions

View File

@@ -388,7 +388,11 @@ describe('float window', function()
row = 1,
})
eq(1001, api.nvim_win_get_config(winid).win)
-- But unrelated config doesn't clear parent win #34286
api.nvim_win_set_config(winid, { title = 'foo' })
eq(1001, api.nvim_win_get_config(winid).win)
command('close')
api.nvim_win_set_config(winid, { title = 'bar' })
api.nvim_win_set_config(winid, { relative = 'editor', row = 1, col = 1 })
eq(nil, api.nvim_win_get_config(winid).win)
end)