aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api/window_spec.lua
diff options
context:
space:
mode:
authorSean Dewar <seandewar@users.noreply.github.com>2024-02-07 21:44:42 +0000
committerSean Dewar <6256228+seandewar@users.noreply.github.com>2024-03-08 23:24:04 +0000
commitb1577d371a6db43222de9e3a525def82320ebdb1 (patch)
tree0be83eff7c0686f63c553f92b1de0486f1867706 /test/functional/api/window_spec.lua
parent5d58136cccc760f6d95eb45b46f2ad60f06b103b (diff)
downloadrneovim-b1577d371a6db43222de9e3a525def82320ebdb1.tar.gz
rneovim-b1577d371a6db43222de9e3a525def82320ebdb1.tar.bz2
rneovim-b1577d371a6db43222de9e3a525def82320ebdb1.zip
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.
Diffstat (limited to 'test/functional/api/window_spec.lua')
-rw-r--r--test/functional/api/window_spec.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/functional/api/window_spec.lua b/test/functional/api/window_spec.lua
index 30235d6b84..246ff50ddc 100644
--- a/test/functional/api/window_spec.lua
+++ b/test/functional/api/window_spec.lua
@@ -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()