1
0
forked from aniani/vim

patch 8.2.0201: cannot assign to an imported variable

Problem:    Cannot assign to an imported variable.
Solution:   Make it work.
This commit is contained in:
Bram Moolenaar
2020-02-03 20:50:59 +01:00
parent b283a8a680
commit 4e12a5df37
6 changed files with 136 additions and 82 deletions

View File

@@ -2296,7 +2296,7 @@ get_var_tv(
if (tv == NULL && current_sctx.sc_version == SCRIPT_VERSION_VIM9)
{
imported_T *import = find_imported(name, NULL);
imported_T *import = find_imported(name, 0, NULL);
// imported variable from another script
if (import != NULL)
@@ -2472,7 +2472,7 @@ lookup_scriptvar(char_u *name, size_t len, cctx_T *dummy UNUSED)
res = HASHITEM_EMPTY(hi) ? -1 : 1;
// if not script-local, then perhaps imported
if (res == -1 && find_imported(p, NULL) != NULL)
if (res == -1 && find_imported(p, 0, NULL) != NULL)
res = 1;
if (p != buffer)