summaryrefslogtreecommitdiffstats
path: root/src/evalvars.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-08-27 21:33:10 +0200
committerBram Moolenaar <Bram@vim.org>2020-08-27 21:33:10 +0200
commit601e76ac3c8fa5d65ac04647a762792ea343ebd5 (patch)
tree787a9de42ab520a3e339a64e6c2116552178692e /src/evalvars.c
parent228e62975e7aef9d6224a5a7c43625c1c1494fc2 (diff)
patch 8.2.1527: Vim9: cannot use a function name at script levelv8.2.1527
Problem: Vim9: cannot use a function name as a function reference at script level. Solution: Check if a name is a function name. (closes #6789)
Diffstat (limited to 'src/evalvars.c')
-rw-r--r--src/evalvars.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/evalvars.c b/src/evalvars.c
index fbf521e718..a946c75ba7 100644
--- a/src/evalvars.c
+++ b/src/evalvars.c
@@ -2461,6 +2461,20 @@ eval_variable(
tv = sv->sv_tv;
}
}
+ else if (in_vim9script())
+ {
+ ufunc_T *ufunc = find_func(name, FALSE, NULL);
+
+ if (ufunc != NULL)
+ {
+ foundFunc = TRUE;
+ if (rettv != NULL)
+ {
+ rettv->v_type = VAR_FUNC;
+ rettv->vval.v_string = vim_strsave(ufunc->uf_name);
+ }
+ }
+ }
}
if (!foundFunc)