summaryrefslogtreecommitdiff
path: root/src/evalfunc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/evalfunc.c')
-rw-r--r--src/evalfunc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/evalfunc.c b/src/evalfunc.c
index 6db930ef2..af46d150a 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -3552,7 +3552,14 @@ f_exists(typval_T *argvars, typval_T *rettv)
}
else if (*p == '*') // internal or user defined function
{
+ int save_version = current_sctx.sc_version;
+
+ // Vim9 script assumes a function is script-local, but here we want to
+ // find any matching function.
+ if (current_sctx.sc_version == SCRIPT_VERSION_VIM9)
+ current_sctx.sc_version = SCRIPT_VERSION_MAX;
n = function_exists(p + 1, FALSE);
+ current_sctx.sc_version = save_version;
}
else if (*p == '?') // internal function only
{