mirror of
https://github.com/neovim/neovim.git
synced 2025-09-30 15:08:35 +00:00
api: add textlock check
This commit is contained in:
@@ -260,6 +260,13 @@ for i = 1, #functions do
|
||||
args[#args + 1] = converted
|
||||
end
|
||||
|
||||
if fn.check_textlock then
|
||||
output:write('\n if (textlock != 0) {')
|
||||
output:write('\n api_set_error(error, kErrorTypeException, "%s", e_secure);')
|
||||
output:write('\n goto cleanup;')
|
||||
output:write('\n }\n')
|
||||
end
|
||||
|
||||
-- function call
|
||||
local call_args = table.concat(args, ', ')
|
||||
output:write('\n ')
|
||||
@@ -393,6 +400,16 @@ local function process_function(fn)
|
||||
}
|
||||
]], fn.name))
|
||||
end
|
||||
|
||||
if fn.check_textlock then
|
||||
write_shifted_output(output, [[
|
||||
if (textlock != 0) {
|
||||
api_set_error(&err, kErrorTypeException, "%s", e_secure);
|
||||
goto exit_0;
|
||||
}
|
||||
]])
|
||||
end
|
||||
|
||||
local cparams = ''
|
||||
local free_code = {}
|
||||
for j = #fn.parameters,1,-1 do
|
||||
|
Reference in New Issue
Block a user