mirror of
https://github.com/neovim/neovim.git
synced 2026-08-30 02:51:48 +00:00
fix(api): make win_set_config with "win" for splits need "split/vertical"
Problem: currently, for splits, nvim_win_set_config accepts win without any of split or vertical set, which has little effect and seems error-prone. Solution: require at least one of split or vertical to also be set for splits. Also, update nvim_win_set_config docs, as it's no longer limited to just floating and external windows.
This commit is contained in:
@@ -1727,6 +1727,15 @@ describe('API/win', function()
|
||||
config = api.nvim_win_get_config(win)
|
||||
eq('', config.relative)
|
||||
eq('below', config.split)
|
||||
|
||||
eq(
|
||||
"non-float with 'win' requires at least 'split' or 'vertical'",
|
||||
pcall_err(api.nvim_win_set_config, 0, { win = 0 })
|
||||
)
|
||||
eq(
|
||||
"non-float with 'win' requires at least 'split' or 'vertical'",
|
||||
pcall_err(api.nvim_win_set_config, 0, { win = 0, relative = '' })
|
||||
)
|
||||
end)
|
||||
|
||||
it('creates top-level splits', function()
|
||||
|
||||
Reference in New Issue
Block a user