mirror of
https://github.com/neovim/neovim.git
synced 2025-12-15 10:55:40 +00:00
feat(api): nvim_win_set_config accepts unchanged "noautocmd" #36463
Problem: Cannot reuse same config with noautocmd for both window creation and updates, even when value is unchanged. Solution: Only reject noautocmd changes for existing windows.
This commit is contained in:
@@ -3118,6 +3118,17 @@ describe('API/win', function()
|
||||
eq(t2_alt_win, api.nvim_tabpage_get_win(t2))
|
||||
eq(t1, api.nvim_win_get_tabpage(t2_cur_win))
|
||||
end)
|
||||
it('set_config cannot change "noautocmd" #36409', function()
|
||||
local cfg = { relative = 'editor', row = 1, col = 1, height = 2, width = 2, noautocmd = true }
|
||||
local win = api.nvim_open_win(0, false, cfg)
|
||||
cfg.height = 10
|
||||
eq(true, pcall(api.nvim_win_set_config, win, cfg))
|
||||
cfg.noautocmd = false
|
||||
eq(
|
||||
"'noautocmd' cannot be changed with existing windows",
|
||||
pcall_err(api.nvim_win_set_config, win, cfg)
|
||||
)
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('get_config', function()
|
||||
|
||||
Reference in New Issue
Block a user