diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2018-06-08 10:13:04 +0200 |
|---|---|---|
| committer | Justin M. Keyes <justinkz@gmail.com> | 2018-06-08 10:13:04 +0200 |
| commit | f85cbea725b4d21412dc0ddfd07239307b3b63a4 (patch) | |
| tree | cb88d8d6a010490160b9f7d0b1a236d61d29b323 /src/nvim/generators/gen_api_dispatch.lua | |
| parent | c500f22f3ced8bbc271c4ec50d2217626ba5e97e (diff) | |
| parent | 2ca62239675b0c1e68b01aae1a0d45567b15e319 (diff) | |
| download | rneovim-f85cbea725b4d21412dc0ddfd07239307b3b63a4.tar.gz rneovim-f85cbea725b4d21412dc0ddfd07239307b3b63a4.tar.bz2 rneovim-f85cbea725b4d21412dc0ddfd07239307b3b63a4.zip | |
Merge #7917 'API: buffer updates'
Diffstat (limited to 'src/nvim/generators/gen_api_dispatch.lua')
| -rw-r--r-- | src/nvim/generators/gen_api_dispatch.lua | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/nvim/generators/gen_api_dispatch.lua b/src/nvim/generators/gen_api_dispatch.lua index 2ee1e5d4c5..15fcafb584 100644 --- a/src/nvim/generators/gen_api_dispatch.lua +++ b/src/nvim/generators/gen_api_dispatch.lua @@ -223,6 +223,11 @@ for i = 1, #functions do output:write('\n } else if (args.items['..(j - 1)..'].type == kObjectTypeInteger && args.items['..(j - 1)..'].data.integer >= 0) {') output:write('\n '..converted..' = (handle_T)args.items['..(j - 1)..'].data.integer;') end + -- accept empty lua tables as empty dictionarys + if rt:match('^Dictionary') then + output:write('\n } else if (args.items['..(j - 1)..'].type == kObjectTypeArray && args.items['..(j - 1)..'].data.array.size == 0) {') + output:write('\n '..converted..' = (Dictionary)ARRAY_DICT_INIT;') + end output:write('\n } else {') output:write('\n api_set_error(error, kErrorTypeException, "Wrong type for argument '..j..', expecting '..param[1]..'");') output:write('\n goto cleanup;') |