Mercurial > vim
comparison src/vim9compile.c @ 31172:4bde058d0be7 v9.0.0920
patch 9.0.0920: cannot find an import prefixed with "s:"
Commit: https://github.com/vim/vim/commit/b775e724394e05f3648fcb5f977979a592dd3f8c
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Nov 22 18:12:44 2022 +0000
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 https://github.com/vim/vim/issues/11585)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 22 Nov 2022 19:15:02 +0100 |
parents | 3e8aed429cc5 |
children | 307f68a41b03 |
comparison
equal
deleted
inserted
replaced
31171:ea19046c05f2 | 31172:4bde058d0be7 |
---|---|
654 * If "load" is TRUE and the script was not loaded yet, load it now. | 654 * If "load" is TRUE and the script was not loaded yet, load it now. |
655 */ | 655 */ |
656 imported_T * | 656 imported_T * |
657 find_imported(char_u *name, size_t len, int load) | 657 find_imported(char_u *name, size_t len, int load) |
658 { | 658 { |
659 imported_T *ret; | |
660 | |
661 if (!SCRIPT_ID_VALID(current_sctx.sc_sid)) | 659 if (!SCRIPT_ID_VALID(current_sctx.sc_sid)) |
662 return NULL; | 660 return NULL; |
663 | 661 |
664 ret = find_imported_in_script(name, len, current_sctx.sc_sid); | 662 // Skip over "s:" before "s:something" to find the import name. |
663 int off = name[0] == 's' && name[1] == ':' ? 2 : 0; | |
664 | |
665 imported_T *ret = find_imported_in_script(name + off, len - off, | |
666 current_sctx.sc_sid); | |
665 if (ret != NULL && load && (ret->imp_flags & IMP_FLAGS_AUTOLOAD)) | 667 if (ret != NULL && load && (ret->imp_flags & IMP_FLAGS_AUTOLOAD)) |
666 { | 668 { |
667 scid_T actual_sid = 0; | 669 scid_T actual_sid = 0; |
668 int save_emsg_off = emsg_off; | 670 int save_emsg_off = emsg_off; |
669 | 671 |