1
0
forked from aniani/vim

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.
This commit is contained in:
Bram Moolenaar
2022-01-22 11:27:29 +00:00
parent 3d8e25a6d2
commit b697dc295d
3 changed files with 46 additions and 2 deletions

View File

@@ -621,12 +621,12 @@ find_imported(char_u *name, size_t len, int load, cctx_T *cctx)
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);
}