aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/highlight.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2023-02-16 10:07:18 -0500
committerGitHub <noreply@github.com>2023-02-16 07:07:18 -0800
commit09b3432eaff3abcadb56d61b6f247f992b80b63f (patch)
tree389efec63429f482fcab4bebaeeac6e3d948f14e /src/nvim/highlight.c
parentbcae4af3743dbc8fc51027bbe323ddc9211cd8ca (diff)
downloadrneovim-09b3432eaff3abcadb56d61b6f247f992b80b63f.tar.gz
rneovim-09b3432eaff3abcadb56d61b6f247f992b80b63f.tar.bz2
rneovim-09b3432eaff3abcadb56d61b6f247f992b80b63f.zip
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: https://github.com/neovim/neovim/blob/fae754073289566051433fae74ec65783f9e7a6a/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
Diffstat (limited to 'src/nvim/highlight.c')
-rw-r--r--src/nvim/highlight.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/highlight.c b/src/nvim/highlight.c
index cf72102b60..72da66cfc2 100644
--- a/src/nvim/highlight.c
+++ b/src/nvim/highlight.c
@@ -1025,7 +1025,7 @@ HlAttrs dict2hlattrs(Dict(highlight) *dict, bool use_rgb, int *link_id, Error *e
// TODO(clason): handle via gen_api_dispatch
cterm_mask_provided = true;
} else if (HAS_KEY(dict->cterm)) {
- VALIDATE_T("cterm", kObjectTypeDictionary, dict->cterm.type, {
+ VALIDATE_EXP(false, "cterm", "Dict", api_typename(dict->cterm.type), {
return hlattrs;
});
}