diff src/evalvars.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 c9474ae175f4
children 140102677c12
line wrap: on
line diff
--- a/src/evalvars.c
+++ b/src/evalvars.c
@@ -2683,7 +2683,7 @@ eval_variable(
 	char_u	    *p = STRNCMP(name, "s:", 2) == 0 ? name + 2 : name;
 
 	if (sid == 0)
-	    import = find_imported(p, 0, NULL);
+	    import = find_imported(p, 0, TRUE, NULL);
 
 	// imported variable from another script
 	if (import != NULL || sid != 0)
@@ -3015,7 +3015,7 @@ lookup_scriptitem(
     res = HASHITEM_EMPTY(hi) ? FAIL : OK;
 
     // if not script-local, then perhaps imported
-    if (res == FAIL && find_imported(p, 0, NULL) != NULL)
+    if (res == FAIL && find_imported(p, 0, FALSE, NULL) != NULL)
 	res = OK;
     if (p != buffer)
 	vim_free(p);
@@ -3388,7 +3388,7 @@ set_var_const(
 
     if (di == NULL && var_in_vim9script)
     {
-	imported_T  *import = find_imported(varname, 0, NULL);
+	imported_T  *import = find_imported(varname, 0, FALSE, NULL);
 
 	if (import != NULL)
 	{