diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-02-18 19:11:44 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-18 19:11:44 +0800 |
commit | b8c34efe3399b0786a0e00012cfa3a05a4aa4654 (patch) | |
tree | 5cf06572e1aa937f048faec77c63bc4e98837152 /src/nvim/eval/funcs.c | |
parent | 796df966f3cb83698035b85522504d40e7b5ab0b (diff) | |
download | rneovim-b8c34efe3399b0786a0e00012cfa3a05a4aa4654.tar.gz rneovim-b8c34efe3399b0786a0e00012cfa3a05a4aa4654.tar.bz2 rneovim-b8c34efe3399b0786a0e00012cfa3a05a4aa4654.zip |
fix(eval): skip over v:lua properly (#27517)
Problem: Error when parsing v:lua in a ternary expression.
Solution: Set rettv->v_type for v:lua even if not evaluating.
Diffstat (limited to 'src/nvim/eval/funcs.c')
-rw-r--r-- | src/nvim/eval/funcs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c index 28365e16df..8dbff8a7a6 100644 --- a/src/nvim/eval/funcs.c +++ b/src/nvim/eval/funcs.c @@ -1726,7 +1726,7 @@ static void f_exists(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) n = false; // Trailing garbage. } } else if (*p == '*') { // Internal or user defined function. - n = strncmp(p, "*v:lua.", 7) == 0 ? nlua_func_exists(p + 7) : function_exists(p + 1, false); + n = strnequal(p, "*v:lua.", 7) ? nlua_func_exists(p + 7) : function_exists(p + 1, false); } else if (*p == ':') { n = cmd_exists(p + 1); } else if (*p == '#') { |