diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2019-07-01 15:50:57 +0200 |
---|---|---|
committer | Björn Linse <bjorn.linse@gmail.com> | 2019-07-01 18:44:58 +0200 |
commit | 6ee05536ca2668b8d45103a63be38b1de698c4a9 (patch) | |
tree | fcbaeedf66c77ff67c906f10b6ea29c5bd3bf733 /src/nvim/lua/executor.c | |
parent | 740fb337dd8c63b63db186057fca2994b92ddbf5 (diff) | |
download | rneovim-6ee05536ca2668b8d45103a63be38b1de698c4a9.tar.gz rneovim-6ee05536ca2668b8d45103a63be38b1de698c4a9.tar.bz2 rneovim-6ee05536ca2668b8d45103a63be38b1de698c4a9.zip |
api/lua: make nvim_execute_lua use native lua floats, not special tables
Rationale: the purpose of nvim_execute_lua is to simply call lua code with lua
values. If a lua function expects a floating point value, it should be enough
to specify a float as argument to nvim_execute_lua.
However, make sure to preserve the existing roundtripping behavior of
API values when using `vim.api` functions. This is covered by existing
lua/api_spec.lua tests.
Diffstat (limited to 'src/nvim/lua/executor.c')
-rw-r--r-- | src/nvim/lua/executor.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c index 4fd4e4c4fa..3fd1620845 100644 --- a/src/nvim/lua/executor.c +++ b/src/nvim/lua/executor.c @@ -562,7 +562,7 @@ Object executor_exec_lua_api(const String str, const Array args, Error *err) } for (size_t i = 0; i < args.size; i++) { - nlua_push_Object(lstate, args.items[i]); + nlua_push_Object(lstate, args.items[i], false); } if (lua_pcall(lstate, (int)args.size, 1, 0)) { @@ -583,7 +583,7 @@ Object executor_exec_lua_cb(LuaRef ref, const char *name, Array args, nlua_pushref(lstate, ref); lua_pushstring(lstate, name); for (size_t i = 0; i < args.size; i++) { - nlua_push_Object(lstate, args.items[i]); + nlua_push_Object(lstate, args.items[i], false); } if (lua_pcall(lstate, (int)args.size+1, retval ? 1 : 0, 0)) { |