fix(api): merge split window config only on success

Problem: nvim_win_set_config may merge configs despite failing to configure a
split, and without applying necessary side-effects (like setting style=minimal
options). Plus, autocommands may apply a different config after the merge,
causing side-effects to apply for an outdated config.

Solution: merge configs last, only on success. Include fields only relevant to
splits. Properly set _cmdline_offset for splits.

Maybe better to disallow _cmdline_offset for splits instead, as the pum is
relative to cmdline_row anyway? (I didn't want to change behaviour too much)

Also use expect_unchanged in an unrelated test to quash a warning.
This commit is contained in:
Sean Dewar
2026-03-07 12:12:02 +00:00
parent 65a1709112
commit 137d5ab01d
5 changed files with 71 additions and 21 deletions

View File

@@ -8942,17 +8942,7 @@ describe('float window', function()
unchanged = true,
}
else
screen:expect([[
Ut enim ad minim veniam, quis nostrud |
exercitation ullamco laboris nisi ut aliquip ex |
ea co{2:test}{3:o consequat}. Duis aute irure dolor in |
repre{3:henderit in vol}uptate velit esse cillum |
dolor{2:popup}{3:fugi}{2:text}{3:ul}la pariatur. Excepteur sint |
occaecat cupidatat non proident, sunt in culpa |
qui officia deserunt mollit anim id est |
laborum^. |
|
]])
screen:expect_unchanged()
end
api.nvim_buf_set_lines(buf, 0, -1, true, test_data)