Mercurial > vim
comparison src/vim9script.c @ 27086:1e2a6c6c7e42 v8.2.4072
patch 8.2.4072: Vim9: compiling function fails when autoload is not loaded
Commit: https://github.com/vim/vim/commit/d041f4208b0a2149e9d41f6443aa1c14c076a411
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Jan 12 19:54:00 2022 +0000
patch 8.2.4072: Vim9: compiling function fails when autoload is not loaded
Problem: Vim9: compiling function fails when autoload script is not loaded
yet.
Solution: Depend on runtime loading.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 12 Jan 2022 21:00:05 +0100 |
parents | 19fefc42a063 |
children | 70ad00a80185 |
comparison
equal
deleted
inserted
replaced
27085:40b273e28f26 | 27086:1e2a6c6c7e42 |
---|---|
486 goto erret; | 486 goto erret; |
487 vim_snprintf((char *)from_name, len, "autoload/%s", tv.vval.v_string); | 487 vim_snprintf((char *)from_name, len, "autoload/%s", tv.vval.v_string); |
488 // we need a scriptitem without loading the script | 488 // we need a scriptitem without loading the script |
489 sid = find_script_in_rtp(from_name); | 489 sid = find_script_in_rtp(from_name); |
490 vim_free(from_name); | 490 vim_free(from_name); |
491 res = SCRIPT_ID_VALID(sid) ? OK : FAIL; | 491 if (SCRIPT_ID_VALID(sid)) |
492 { | |
493 scriptitem_T *si = SCRIPT_ITEM(sid); | |
494 | |
495 if (si->sn_autoload_prefix == NULL) | |
496 si->sn_autoload_prefix = get_autoload_prefix(si); | |
497 res = OK; | |
498 } | |
499 else | |
500 res = FAIL; | |
492 } | 501 } |
493 else | 502 else |
494 { | 503 { |
495 size_t len = 7 + STRLEN(tv.vval.v_string) + 1; | 504 size_t len = 7 + STRLEN(tv.vval.v_string) + 1; |
496 char_u *from_name; | 505 char_u *from_name; |