0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 9.0.0920: cannot find an import prefixed with "s:"

Problem:    Cannot find an import prefixed with "s:". (Doug Kearns)
Solution:   Skip over the "s:". (closes #11585)
This commit is contained in:
Bram Moolenaar
2022-11-22 18:12:44 +00:00
parent 9c5b7cb4cf
commit b775e72439
3 changed files with 16 additions and 3 deletions

View File

@@ -656,12 +656,14 @@ find_imported_in_script(char_u *name, size_t len, int sid)
imported_T *
find_imported(char_u *name, size_t len, int load)
{
imported_T *ret;
if (!SCRIPT_ID_VALID(current_sctx.sc_sid))
return NULL;
ret = find_imported_in_script(name, len, current_sctx.sc_sid);
// Skip over "s:" before "s:something" to find the import name.
int off = name[0] == 's' && name[1] == ':' ? 2 : 0;
imported_T *ret = find_imported_in_script(name + off, len - off,
current_sctx.sc_sid);
if (ret != NULL && load && (ret->imp_flags & IMP_FLAGS_AUTOLOAD))
{
scid_T actual_sid = 0;