diff options
-rw-r--r-- | src/nvim/eval.c | 8 | ||||
-rw-r--r-- | src/nvim/eval/user_funcs.c | 4 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 02ea0c88fc..6f9dcd48df 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -8250,9 +8250,15 @@ static void check_vars(const char *name, size_t len) } /// check if special v:lua value for calling lua functions +bool is_luafunc(partial_T *partial) +{ + return partial == vvlua_partial; +} + +/// check if special v:lua value for calling lua functions static bool tv_is_luafunc(typval_T *tv) { - return tv->v_type == VAR_PARTIAL && tv->vval.v_partial == vvlua_partial; + return tv->v_type == VAR_PARTIAL && is_luafunc(tv->vval.v_partial); } /// check the function name after "v:lua." diff --git a/src/nvim/eval/user_funcs.c b/src/nvim/eval/user_funcs.c index b3bd1e2860..b3706c7754 100644 --- a/src/nvim/eval/user_funcs.c +++ b/src/nvim/eval/user_funcs.c @@ -1304,7 +1304,7 @@ call_func( rettv->vval.v_number = 0; error = ERROR_UNKNOWN; - if (partial == vvlua_partial) { + if (is_luafunc(partial)) { if (len > 0) { error = ERROR_NONE; executor_call_lua((const char *)funcname, len, @@ -1556,7 +1556,7 @@ trans_function_name( *pp = (char_u *)end; } else if (lv.ll_tv->v_type == VAR_PARTIAL && lv.ll_tv->vval.v_partial != NULL) { - if (lv.ll_tv->vval.v_partial == vvlua_partial && *end == '.') { + if (is_luafunc(lv.ll_tv->vval.v_partial) && *end == '.') { len = check_luafunc_name((const char *)end+1, true); if (len == 0) { EMSG2(e_invexpr2, "v:lua"); |