1
0
forked from aniani/vim

patch 8.2.2975: Vim9: can only use an autoload function name as a string

Problem:    Vim9: can only use an autoload function name as a string.
Solution:   Load the autoload script when encountered. (closes #8124)
This commit is contained in:
Bram Moolenaar
2021-06-11 22:05:47 +02:00
parent 4f13527598
commit f0a4069e3d
5 changed files with 43 additions and 3 deletions

View File

@@ -3084,7 +3084,13 @@ compile_load(
if (name == NULL)
return FAIL;
if (arg_exists(*arg, len, &idx, &type, &gen_load_outer, cctx) == OK)
if (vim_strchr(name, AUTOLOAD_CHAR) != NULL)
{
script_autoload(name, FALSE);
res = generate_LOAD(cctx, ISN_LOADAUTO, 0, name, &t_any);
}
else if (arg_exists(*arg, len, &idx, &type, &gen_load_outer, cctx)
== OK)
{
if (gen_load_outer == 0)
gen_load = TRUE;