diff src/evalvars.c @ 24874:14b0b35d8488 v8.2.2975

patch 8.2.2975: Vim9: can only use an autoload function name as a string Commit: https://github.com/vim/vim/commit/f0a4069e3df904ac6bd57718ec06e56c5d7363e4 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jun 11 22:05:47 2021 +0200 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 https://github.com/vim/vim/issues/8124)
author Bram Moolenaar <Bram@vim.org>
date Fri, 11 Jun 2021 22:15:03 +0200
parents f1a390885192
children 0d8baefcf4ed
line wrap: on
line diff
--- a/src/evalvars.c
+++ b/src/evalvars.c
@@ -2921,8 +2921,9 @@ find_var_ht(char_u *name, char_u **varna
 	if (ht != NULL)
 	    return ht;				// local variable
 
-	// in Vim9 script items at the script level are script-local
-	if (in_vim9script())
+	// In Vim9 script items at the script level are script-local, except
+	// for autoload names.
+	if (in_vim9script() && vim_strchr(name, AUTOLOAD_CHAR) == NULL)
 	{
 	    ht = get_script_local_ht();
 	    if (ht != NULL)