1
0
forked from aniani/vim

patch 8.2.0960: cannot use :import in legacy Vim script

Problem:    Cannot use :import in legacy Vim script.
Solution:   Support :import in any Vim script.
This commit is contained in:
Bram Moolenaar
2020-06-11 23:10:46 +02:00
parent 00e260bb6c
commit 9721fb4ea3
5 changed files with 90 additions and 24 deletions

View File

@@ -2359,9 +2359,13 @@ get_var_tv(
*dip = v;
}
if (tv == NULL && current_sctx.sc_version == SCRIPT_VERSION_VIM9)
if (tv == NULL && (current_sctx.sc_version == SCRIPT_VERSION_VIM9
|| STRNCMP(name, "s:", 2) == 0))
{
imported_T *import = find_imported(name, 0, NULL);
imported_T *import;
char_u *p = STRNCMP(name, "s:", 2) == 0 ? name + 2 : name;
import = find_imported(p, 0, NULL);
// imported variable from another script
if (import != NULL)