mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 03:48:18 +00:00
fix(api): allow empty Lua table for nested dicts #22268
Problem:
The Lua-API bridge allows Dict params to be empty Lua (list) tables at
the function-signature level. But not for _nested_ Dicts, because they
are not modeled:
fae7540732/src/nvim/api/keysets.lua (L184)
Some API functions like nvim_cmd check for kObjectTypeDictionary and
don't handle the case of empty Lua tables (treated as "Array").
Solution:
Introduce VALIDATE_T_DICT and use it in places where
kObjectTypeDictionary was being checked directly.
fixes #21005
This commit is contained in:
@@ -24,7 +24,7 @@ describe('nvim_get_commands', function()
|
||||
eq({}, meths.get_commands({builtin=false}))
|
||||
end)
|
||||
|
||||
it('validates input', function()
|
||||
it('validation', function()
|
||||
eq('builtin=true not implemented', pcall_err(meths.get_commands,
|
||||
{builtin=true}))
|
||||
eq("Invalid key: 'foo'", pcall_err(meths.get_commands,
|
||||
|
Reference in New Issue
Block a user