diff src/list.c @ 13246:dd3b2ecf91f6 v8.0.1497

patch 8.0.1497: getting the jump list requires parsing the output of :jumps commit https://github.com/vim/vim/commit/4f50588ba336e7f086a72c53f5688c2494fc34b3 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Feb 10 21:06:32 2018 +0100 patch 8.0.1497: getting the jump list requires parsing the output of :jumps Problem: Getting the jump list requires parsing the output of :jumps. Solution: Add getjumplist(). (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/2609)
author Christian Brabandt <cb@256bit.org>
date Sat, 10 Feb 2018 21:15:05 +0100
parents aec3df2af27c
children 46f14852a919
line wrap: on
line diff
--- a/src/list.c
+++ b/src/list.c
@@ -475,6 +475,27 @@ list_append_dict(list_T *list, dict_T *d
 }
 
 /*
+ * Append list2 to list1.
+ * Return FAIL when out of memory.
+ */
+    int
+list_append_list(list1, list2)
+    list_T	*list1;
+    list_T	*list2;
+{
+    listitem_T	*li = listitem_alloc();
+
+    if (li == NULL)
+	return FAIL;
+    li->li_tv.v_type = VAR_LIST;
+    li->li_tv.v_lock = 0;
+    li->li_tv.vval.v_list = list2;
+    list_append(list1, li);
+    ++list2->lv_refcount;
+    return OK;
+}
+
+/*
  * Make a copy of "str" and append it as an item to list "l".
  * When "len" >= 0 use "str[len]".
  * Returns FAIL when out of memory.