patch 9.0.0741: cannot specify an ID for each item with prop_add_list()
Problem: Cannot specify an ID for each item with prop_add_list(). (Sergey
Vlasov)
Solution: Add an optional fifth number to the item. (closes #11360)
diff --git a/src/textprop.c b/src/textprop.c
index 9256368..808d1e6 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -396,6 +396,9 @@
end_lnum = list_find_nr(pos_list, 2L, &error);
if (!error)
end_col = list_find_nr(pos_list, 3L, &error);
+ int this_id = id;
+ if (!error && pos_list->lv_len > 4)
+ this_id = list_find_nr(pos_list, 4L, &error);
if (error || start_lnum <= 0 || start_col <= 0
|| end_lnum <= 0 || end_col <= 0)
{
@@ -403,8 +406,8 @@
emsg(_(e_invalid_argument));
return;
}
- if (prop_add_one(buf, type_name, id, NULL, 0, 0, start_lnum, end_lnum,
- start_col, end_col) == FAIL)
+ if (prop_add_one(buf, type_name, this_id, NULL, 0, 0,
+ start_lnum, end_lnum, start_col, end_col) == FAIL)
return;
}