diff src/vim9script.c @ 27116:5b267700e6ab v8.2.4087

patch 8.2.4087: cannot test items from an autoload script easily Commit: https://github.com/vim/vim/commit/3e4fa3d7d37162cd08fc0c6e83f52fd323f63eba Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jan 13 22:05:09 2022 +0000 patch 8.2.4087: cannot test items from an autoload script easily Problem: Cannot test items from an autoload script easily. Solution: Add the "autoload" value for test_override().
author Bram Moolenaar <Bram@vim.org>
date Thu, 13 Jan 2022 23:15:03 +0100
parents 98a01021e465
children 7b8e2bea0ec5
line wrap: on
line diff
--- a/src/vim9script.c
+++ b/src/vim9script.c
@@ -496,6 +496,9 @@ handle_import(
 	    if (si->sn_autoload_prefix == NULL)
 		si->sn_autoload_prefix = get_autoload_prefix(si);
 	    res = OK;
+	    if (override_autoload && si->sn_state == SN_STATE_NOT_LOADED)
+		// testing override: load autoload script right away
+		(void)do_source(si->sn_name, FALSE, DOSO_NONE, NULL);
 	}
 	else
 	    res = FAIL;