diff options
Diffstat (limited to 'src/nvim/generators/gen_api_dispatch.lua')
-rw-r--r-- | src/nvim/generators/gen_api_dispatch.lua | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/nvim/generators/gen_api_dispatch.lua b/src/nvim/generators/gen_api_dispatch.lua index b31209e8ff..7e78b9e9d6 100644 --- a/src/nvim/generators/gen_api_dispatch.lua +++ b/src/nvim/generators/gen_api_dispatch.lua @@ -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 |