summaryrefslogtreecommitdiff
path: root/src/vim9script.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-01-12 19:54:00 +0000
committerBram Moolenaar <Bram@vim.org>2022-01-12 19:54:00 +0000
commitd041f4208b0a2149e9d41f6443aa1c14c076a411 (patch)
tree2fed762d017d9bae0177f03d021964b321db35f5 /src/vim9script.c
parent53c296112edd8471eb63afbca03f96bad164c813 (diff)
downloadvim-git-d041f4208b0a2149e9d41f6443aa1c14c076a411.tar.gz
patch 8.2.4072: Vim9: compiling function fails when autoload is not loadedv8.2.4072
Problem: Vim9: compiling function fails when autoload script is not loaded yet. Solution: Depend on runtime loading.
Diffstat (limited to 'src/vim9script.c')
-rw-r--r--src/vim9script.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/vim9script.c b/src/vim9script.c
index b72995c11..6d02be6ad 100644
--- a/src/vim9script.c
+++ b/src/vim9script.c
@@ -488,7 +488,16 @@ handle_import(
// we need a scriptitem without loading the script
sid = find_script_in_rtp(from_name);
vim_free(from_name);
- res = SCRIPT_ID_VALID(sid) ? OK : FAIL;
+ if (SCRIPT_ID_VALID(sid))
+ {
+ scriptitem_T *si = SCRIPT_ITEM(sid);
+
+ if (si->sn_autoload_prefix == NULL)
+ si->sn_autoload_prefix = get_autoload_prefix(si);
+ res = OK;
+ }
+ else
+ res = FAIL;
}
else
{