diff src/vim9compile.c @ 27297:f7cb41ff22a4 v8.2.4177

patch 8.2.4177: Vim9: autoload script not loaded after "vim9script noclear" Commit: https://github.com/vim/vim/commit/b697dc295d0625bf2445649f03019f9b8fccc1a8 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jan 22 11:27:29 2022 +0000 patch 8.2.4177: Vim9: autoload script not loaded after "vim9script noclear" Problem: Vim9: autoload script not loaded after "vim9script noclear". Solution: Check IMP_FLAGS_AUTOLOAD properly.
author Bram Moolenaar <Bram@vim.org>
date Sat, 22 Jan 2022 12:30:04 +0100
parents 44cb142c8615
children 9a9c34c84cd4
line wrap: on
line diff
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -621,12 +621,12 @@ find_imported(char_u *name, size_t len, 
     if (ret == NULL)
 	ret = find_imported_in_script(name, len, current_sctx.sc_sid);
 
-    if (ret != NULL && load && ret->imp_flags == IMP_FLAGS_AUTOLOAD)
+    if (ret != NULL && load && (ret->imp_flags & IMP_FLAGS_AUTOLOAD))
     {
 	scid_T dummy;
 
 	// script found before but not loaded yet
-	ret->imp_flags = 0;
+	ret->imp_flags &= ~IMP_FLAGS_AUTOLOAD;
 	(void)do_source(SCRIPT_ITEM(ret->imp_sid)->sn_name, FALSE,
 							    DOSO_NONE, &dummy);
     }