aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/viml/executor/executor.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/viml/executor/executor.c')
-rw-r--r--src/nvim/viml/executor/executor.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/nvim/viml/executor/executor.c b/src/nvim/viml/executor/executor.c
index 38e3cf1c6d..fb39716f5c 100644
--- a/src/nvim/viml/executor/executor.c
+++ b/src/nvim/viml/executor/executor.c
@@ -277,9 +277,14 @@ void executor_eval_lua(const String str, typval_T *const arg,
void ex_lua(exarg_T *const eap)
FUNC_ATTR_NONNULL_ALL
{
- char *const code = (char *)script_get(eap, eap->arg);
+ size_t len;
+ char *const code = script_get(eap, &len);
+ if (eap->skip) {
+ xfree(code);
+ return;
+ }
typval_T tv = { .v_type = VAR_UNKNOWN };
- executor_exec_lua(cstr_as_string(code), &tv);
+ executor_exec_lua((String) { .data = code, .size = len }, &tv);
clear_tv(&tv);
xfree(code);
}