diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-06-11 23:10:46 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-06-11 23:10:46 +0200 |
commit | 9721fb4ea3db2559aaf7f71458da8ddda30ff93e (patch) | |
tree | 39623a8707ce913b2ad27eb3bac25a7f522e338d /src/evalvars.c | |
parent | 00e260bb6cc33ff5dbba15ac87ca7fd465aa49c0 (diff) | |
download | vim-git-9721fb4ea3db2559aaf7f71458da8ddda30ff93e.tar.gz |
patch 8.2.0960: cannot use :import in legacy Vim scriptv8.2.0960
Problem: Cannot use :import in legacy Vim script.
Solution: Support :import in any Vim script.
Diffstat (limited to 'src/evalvars.c')
-rw-r--r-- | src/evalvars.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/evalvars.c b/src/evalvars.c index 8b3ce2e90..3d03ed8f1 100644 --- a/src/evalvars.c +++ b/src/evalvars.c @@ -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) |