comparison 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
comparison
equal deleted inserted replaced
20815:1b780bd39c59 20816:9faab49c880f
2357 tv = &v->di_tv; 2357 tv = &v->di_tv;
2358 if (dip != NULL) 2358 if (dip != NULL)
2359 *dip = v; 2359 *dip = v;
2360 } 2360 }
2361 2361
2362 if (tv == NULL && current_sctx.sc_version == SCRIPT_VERSION_VIM9) 2362 if (tv == NULL && (current_sctx.sc_version == SCRIPT_VERSION_VIM9
2363 { 2363 || STRNCMP(name, "s:", 2) == 0))
2364 imported_T *import = find_imported(name, 0, NULL); 2364 {
2365 imported_T *import;
2366 char_u *p = STRNCMP(name, "s:", 2) == 0 ? name + 2 : name;
2367
2368 import = find_imported(p, 0, NULL);
2365 2369
2366 // imported variable from another script 2370 // imported variable from another script
2367 if (import != NULL) 2371 if (import != NULL)
2368 { 2372 {
2369 scriptitem_T *si = SCRIPT_ITEM(import->imp_sid); 2373 scriptitem_T *si = SCRIPT_ITEM(import->imp_sid);