From 6ee05536ca2668b8d45103a63be38b1de698c4a9 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Mon, 1 Jul 2019 15:50:57 +0200 Subject: 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. --- src/nvim/generators/gen_api_dispatch.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/generators') diff --git a/src/nvim/generators/gen_api_dispatch.lua b/src/nvim/generators/gen_api_dispatch.lua index 3ebcd2d1c4..286fef9a2f 100644 --- a/src/nvim/generators/gen_api_dispatch.lua +++ b/src/nvim/generators/gen_api_dispatch.lua @@ -441,7 +441,7 @@ local function process_function(fn) end write_shifted_output(output, string.format([[ const %s ret = %s(%s); - nlua_push_%s(lstate, ret); + nlua_push_%s(lstate, ret, true); api_free_%s(ret); %s %s -- cgit