diff options
author | Yatao Li <yatli@microsoft.com> | 2020-03-05 15:51:02 +0800 |
---|---|---|
committer | Yatao Li <yatli@microsoft.com> | 2020-04-28 01:53:43 +0800 |
commit | ed6230434b2b0a07ece03272b871412929bfcb53 (patch) | |
tree | 54072632d666f18df56b53cf2ae593d58acebd8f /src | |
parent | 6da16ac931eec7be2487ee98e7f605fa12b0171d (diff) | |
download | rneovim-ed6230434b2b0a07ece03272b871412929bfcb53.tar.gz rneovim-ed6230434b2b0a07ece03272b871412929bfcb53.tar.bz2 rneovim-ed6230434b2b0a07ece03272b871412929bfcb53.zip |
gen_api_dispatch.lua: allow msgpack int for Float args; test: add ui_pum_set_bounds and tv_dict_add_float tests
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/generators/gen_api_dispatch.lua | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nvim/generators/gen_api_dispatch.lua b/src/nvim/generators/gen_api_dispatch.lua index e861cfda35..6e80ad0e5c 100644 --- a/src/nvim/generators/gen_api_dispatch.lua +++ b/src/nvim/generators/gen_api_dispatch.lua @@ -237,6 +237,12 @@ for i = 1, #functions do (j - 1)..'].type == kObjectTypeInteger && args.items['..(j - 1)..'].data.integer >= 0) {') output:write('\n '..converted..' = (handle_T)args.items['..(j - 1)..'].data.integer;') end + if rt:match('^Float$') then + -- accept integers for Floats + output:write('\n } else if (args.items['.. + (j - 1)..'].type == kObjectTypeInteger) {') + output:write('\n '..converted..' = (Float)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) {') --luacheck: ignore 631 |