diff src/vim9expr.c @ 27043:15f40772e10a v8.2.4050

patch 8.2.4050: Vim9: need to prefix every item in an autoload script Commit: https://github.com/vim/vim/commit/dc4451df61a6aa12a0661817b7094fb32f09e11d Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jan 9 21:36:37 2022 +0000 patch 8.2.4050: Vim9: need to prefix every item in an autoload script Problem: Vim9: need to prefix every item in an autoload script. Solution: First step in supporting "vim9script autoload" and "import autoload".
author Bram Moolenaar <Bram@vim.org>
date Sun, 09 Jan 2022 22:45:04 +0100
parents fc19375787dd
children 1e2a6c6c7e42
line wrap: on
line diff
--- a/src/vim9expr.c
+++ b/src/vim9expr.c
@@ -266,7 +266,7 @@ compile_load_scriptvar(
 	return OK;
     }
 
-    import = end == NULL ? NULL : find_imported(name, 0, cctx);
+    import = end == NULL ? NULL : find_imported(name, 0, FALSE, cctx);
     if (import != NULL)
     {
 	char_u	*p = skipwhite(*end);
@@ -275,6 +275,7 @@ compile_load_scriptvar(
 	ufunc_T	*ufunc;
 	type_T	*type;
 
+	// TODO: if this is an autoload import do something else.
 	// Need to lookup the member.
 	if (*p != '.')
 	{
@@ -474,7 +475,7 @@ compile_load(
 		// "var" can be script-local even without using "s:" if it
 		// already exists in a Vim9 script or when it's imported.
 		if (script_var_exists(*arg, len, cctx) == OK
-			|| find_imported(name, 0, cctx) != NULL)
+			|| find_imported(name, 0, FALSE, cctx) != NULL)
 		   res = compile_load_scriptvar(cctx, name, *arg, &end, FALSE);
 
 		// When evaluating an expression and the name starts with an