diff options
-rw-r--r-- | src/nvim/eval.c | 6 | ||||
-rw-r--r-- | src/nvim/eval/typval_defs.h | 1 |
2 files changed, 5 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; diff --git a/src/nvim/eval/typval_defs.h b/src/nvim/eval/typval_defs.h index 0d6ee28adc..e88e6a222a 100644 --- a/src/nvim/eval/typval_defs.h +++ b/src/nvim/eval/typval_defs.h @@ -364,6 +364,7 @@ struct ufunc { struct partial_S { int pt_refcount; ///< Reference count. + int pt_copyID; char *pt_name; ///< Function name; when NULL use pt_func->name. ufunc_T *pt_func; ///< Function pointer; when NULL lookup function with pt_name. bool pt_auto; ///< When true the partial was created by using dict.member |