diff options
author | Jakub Łuczyński <doubleloop@o2.pl> | 2020-02-11 13:08:32 +0100 |
---|---|---|
committer | Jakub Łuczyński <doubleloop@o2.pl> | 2020-02-13 14:11:48 +0100 |
commit | 3c413f15238d3c48c0606d661841477cb2c9ed5c (patch) | |
tree | fd1883b8dd0fd253fc71626cbccdb967f56e987e /src | |
parent | 1e0a9b26908ab1f48e58435da9efca691179d63d (diff) | |
download | rneovim-3c413f15238d3c48c0606d661841477cb2c9ed5c.tar.gz rneovim-3c413f15238d3c48c0606d661841477cb2c9ed5c.tar.bz2 rneovim-3c413f15238d3c48c0606d661841477cb2c9ed5c.zip |
fix: vvlua_partial
Diffstat (limited to 'src')
-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"); |