0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 8.2.1527: Vim9: cannot use a function name at script level

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)
This commit is contained in:
Bram Moolenaar
2020-08-27 21:33:10 +02:00
parent 228e62975e
commit 601e76ac3c
4 changed files with 39 additions and 7 deletions

View File

@@ -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)