0
0
mirror of https://github.com/vim/vim.git synced 2025-09-11 22:43:48 -04:00

updated for version 7.2c-001

This commit is contained in:
Bram Moolenaar 2008-08-08 10:36:31 +00:00
parent e37d50a5de
commit dc9cf9cd6d
3 changed files with 11 additions and 2 deletions

View File

@ -2681,7 +2681,11 @@ extend({expr1}, {expr2} [, {expr3}]) *extend()*
Examples: > Examples: >
:echo sort(extend(mylist, [7, 5])) :echo sort(extend(mylist, [7, 5]))
:call extend(mylist, [2, 3], 1) :call extend(mylist, [2, 3], 1)
< Use |add()| to concatenate one item to a list. To concatenate < When {expr1} is the same List as {expr2} then the number of
items copied is equal to the original length of the List.
E.g., when {expr3} is 1 you get N new copies of the first item
(where N is the original length of the List).
Use |add()| to concatenate one item to a list. To concatenate
two lists into a new list use the + operator: > two lists into a new list use the + operator: >
:let newlist = [1, 2, 3] + [4, 5] :let newlist = [1, 2, 3] + [4, 5]
< <

View File

@ -6231,8 +6231,11 @@ list_extend(l1, l2, bef)
listitem_T *bef; listitem_T *bef;
{ {
listitem_T *item; listitem_T *item;
int todo = l2->lv_len;
for (item = l2->lv_first; item != NULL; item = item->li_next) /* We also quit the loop when we have inserted the original item count of
* the list, avoid a hang when we extend a list with itself. */
for (item = l2->lv_first; item != NULL && --todo >= 0; item = item->li_next)
if (list_insert_tv(l1, &item->li_tv, bef) == FAIL) if (list_insert_tv(l1, &item->li_tv, bef) == FAIL)
return FAIL; return FAIL;
return OK; return OK;

View File

@ -676,6 +676,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1,
/**/ /**/
0 0
}; };