diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2017-05-09 00:39:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-09 00:39:17 +0200 |
commit | 0e873a30f3072dbacfb700f1e331a8c8396f2e1f (patch) | |
tree | 557792d454fef510a90975bed4e7d1650ee26c4f /src/nvim/eval.c | |
parent | a9981e0e7e9439340bb8c0162f860b78d8002559 (diff) | |
parent | 5b6d598ca8301682d931539ecd6da6a9fabae569 (diff) | |
download | rneovim-0e873a30f3072dbacfb700f1e331a8c8396f2e1f.tar.gz rneovim-0e873a30f3072dbacfb700f1e331a8c8396f2e1f.tar.bz2 rneovim-0e873a30f3072dbacfb700f1e331a8c8396f2e1f.zip |
Merge #4411 from ZyX-I/luaviml'/lua
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 1bf85ccd8b..56a6632fad 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -97,6 +97,7 @@ #include "nvim/lib/kvec.h" #include "nvim/lib/khash.h" #include "nvim/lib/queue.h" +#include "nvim/lua/executor.h" #include "nvim/eval/typval.h" #include "nvim/eval/executor.h" #include "nvim/eval/gc.h" @@ -6510,7 +6511,7 @@ static void api_wrapper(typval_T *argvars, typval_T *rettv, FunPtr fptr) } Error err = ERROR_INIT; - Object result = fn(INTERNAL_CALL, args, &err); + Object result = fn(VIML_INTERNAL_CALL, args, &err); if (ERROR_SET(&err)) { nvim_err_writeln(cstr_as_string(err.msg)); @@ -10973,7 +10974,9 @@ static int inputsecret_flag = 0; * prompt. The third argument to f_inputdialog() specifies the value to return * when the user cancels the prompt. */ -static void get_user_input(typval_T *argvars, typval_T *rettv, int inputdialog) +void get_user_input(const typval_T *const argvars, + typval_T *const rettv, const bool inputdialog) + FUNC_ATTR_NONNULL_ALL { const char *prompt = tv_get_string_chk(&argvars[0]); int cmd_silent_save = cmd_silent; @@ -12076,6 +12079,18 @@ static void get_maparg(typval_T *argvars, typval_T *rettv, int exact) } } +/// luaeval() function implementation +static void f_luaeval(typval_T *argvars, typval_T *rettv, FunPtr fptr) + FUNC_ATTR_NONNULL_ALL +{ + const char *const str = (const char *)tv_get_string_chk(&argvars[0]); + if (str == NULL) { + return; + } + + executor_eval_lua(cstr_as_string((char *)str), &argvars[1], rettv); +} + /* * "map()" function */ |