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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user