patch 9.1.1239: if_python: no tuple data type support
Problem: if_python: no tuple data type support (after v9.1.1232)
Solution: Add support for using Vim tuple in the python interface
(Yegappan Lakshmanan)
closes: #16964
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/gc.c b/src/gc.c
index b95b2ca..c8aa5fa 100644
--- a/src/gc.c
+++ b/src/gc.c
@@ -439,6 +439,21 @@
}
/*
+ * Mark a tuple and its items with "copyID".
+ * Returns TRUE if setting references failed somehow.
+ */
+ int
+set_ref_in_tuple(tuple_T *tuple, int copyID)
+{
+ if (tuple != NULL && tuple->tv_copyID != copyID)
+ {
+ tuple->tv_copyID = copyID;
+ return set_ref_in_tuple_items(tuple, copyID, NULL, NULL);
+ }
+ return FALSE;
+}
+
+/*
* Mark all lists and dicts referenced through tuple "t" with "copyID".
* "ht_stack" is used to add hashtabs to be marked. Can be NULL.
*