aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-05-23 07:04:53 +0800
committerGitHub <noreply@github.com>2024-05-23 07:04:53 +0800
commita599183a274e5102b1244c9aaa7ac6c76d5ba5df (patch)
tree5b19c9165d50a0197a11ce7cf6690bff57673e68 /src/nvim/eval.c
parent5cbd6d9b9f232a6ff22ae3a9af80075404226e4b (diff)
downloadrneovim-a599183a274e5102b1244c9aaa7ac6c76d5ba5df.tar.gz
rneovim-a599183a274e5102b1244c9aaa7ac6c76d5ba5df.tar.bz2
rneovim-a599183a274e5102b1244c9aaa7ac6c76d5ba5df.zip
vim-patch:8.2.0703: Vim9: closure cannot store value in outer context (#28925)
Problem: Vim9: closure cannot store value in outer context. Solution: Make storing value in outer context work. Make :disassemble accept a function reference. https://github.com/vim/vim/commit/b68b346e6db6d3f848e0a89905fcd7777b73c5d8 Funcstack is Vim9script-only. Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r--src/nvim/eval.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index d9c18431dd..2f774f7b9d 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -4836,8 +4836,10 @@ bool set_ref_in_item(typval_T *tv, int copyID, ht_stack_T **ht_stack, list_stack
case VAR_PARTIAL: {
partial_T *pt = tv->vval.v_partial;
- // A partial does not have a copyID, because it cannot contain itself.
- if (pt != NULL) {
+ if (pt != NULL && pt->pt_copyID != copyID) {
+ // Didn't see this partial yet.
+ pt->pt_copyID = copyID;
+
abort = set_ref_in_func(pt->pt_name, pt->pt_func, copyID);
if (pt->pt_dict != NULL) {
typval_T dtv;