mirror of
https://github.com/neovim/neovim.git
synced 2025-10-03 00:18:33 +00:00
libluv: use luv_set_callback to control callback execution
Disable the use of deferred API functions in a fast lua callback Correctly display error messages from a fast lua callback
This commit is contained in:
@@ -349,6 +349,7 @@ output:write([[
|
||||
#include "nvim/api/private/defs.h"
|
||||
#include "nvim/api/private/helpers.h"
|
||||
#include "nvim/lua/converter.h"
|
||||
#include "nvim/lua/executor.h"
|
||||
]])
|
||||
include_headers(output, headers)
|
||||
output:write('\n')
|
||||
@@ -372,6 +373,14 @@ local function process_function(fn)
|
||||
binding=lua_c_function_name,
|
||||
api=fn.name
|
||||
}
|
||||
|
||||
if not fn.fast then
|
||||
write_shifted_output(output, string.format([[
|
||||
if (!nlua_is_deferred_safe(lstate)) {
|
||||
return luaL_error(lstate, e_luv_api_disabled, "%s");
|
||||
}
|
||||
]], fn.name))
|
||||
end
|
||||
local cparams = ''
|
||||
local free_code = {}
|
||||
for j = #fn.parameters,1,-1 do
|
||||
|
Reference in New Issue
Block a user