Mercurial > vim
comparison src/evalvars.c @ 19285:86665583dc83 v8.2.0201
patch 8.2.0201: cannot assign to an imported variable
Commit: https://github.com/vim/vim/commit/4e12a5df37ed4a47ca94a8b9393c768e8ca1f75a
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Feb 3 20:50:59 2020 +0100
patch 8.2.0201: cannot assign to an imported variable
Problem: Cannot assign to an imported variable.
Solution: Make it work.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 03 Feb 2020 21:00:04 +0100 |
parents | 9dc843109c97 |
children | 2bb0e80fcd32 |
comparison
equal
deleted
inserted
replaced
19284:938f4994ad87 | 19285:86665583dc83 |
---|---|
2294 *dip = v; | 2294 *dip = v; |
2295 } | 2295 } |
2296 | 2296 |
2297 if (tv == NULL && current_sctx.sc_version == SCRIPT_VERSION_VIM9) | 2297 if (tv == NULL && current_sctx.sc_version == SCRIPT_VERSION_VIM9) |
2298 { | 2298 { |
2299 imported_T *import = find_imported(name, NULL); | 2299 imported_T *import = find_imported(name, 0, NULL); |
2300 | 2300 |
2301 // imported variable from another script | 2301 // imported variable from another script |
2302 if (import != NULL) | 2302 if (import != NULL) |
2303 { | 2303 { |
2304 scriptitem_T *si = SCRIPT_ITEM(import->imp_sid); | 2304 scriptitem_T *si = SCRIPT_ITEM(import->imp_sid); |
2470 | 2470 |
2471 hi = hash_find(ht, p); | 2471 hi = hash_find(ht, p); |
2472 res = HASHITEM_EMPTY(hi) ? -1 : 1; | 2472 res = HASHITEM_EMPTY(hi) ? -1 : 1; |
2473 | 2473 |
2474 // if not script-local, then perhaps imported | 2474 // if not script-local, then perhaps imported |
2475 if (res == -1 && find_imported(p, NULL) != NULL) | 2475 if (res == -1 && find_imported(p, 0, NULL) != NULL) |
2476 res = 1; | 2476 res = 1; |
2477 | 2477 |
2478 if (p != buffer) | 2478 if (p != buffer) |
2479 vim_free(p); | 2479 vim_free(p); |
2480 return res; | 2480 return res; |