Mercurial > vim
diff src/evalvars.c @ 20816:9faab49c880f v8.2.0960
patch 8.2.0960: cannot use :import in legacy Vim script
Commit: https://github.com/vim/vim/commit/9721fb4ea3db2559aaf7f71458da8ddda30ff93e
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Jun 11 23:10:46 2020 +0200
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 11 Jun 2020 23:15:03 +0200 |
parents | ab27db64f1fb |
children | 9064044fd4f6 |
line wrap: on
line diff
--- 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)