comparison src/eval.c @ 5608:ec02e1474bc2 v7.4.151

updated for version 7.4.151 Problem: Python: slices with steps are not supported. Solution: Support slices in Python vim.List. (ZyX)
author Bram Moolenaar <bram@vim.org>
date Tue, 14 Jan 2014 16:36:51 +0100
parents b43363a7b4c7
children 71837ace77df
comparison
equal deleted inserted replaced
5607:98a642716acc 5608:ec02e1474bc2
6423 listitem_T *ni = listitem_alloc(); 6423 listitem_T *ni = listitem_alloc();
6424 6424
6425 if (ni == NULL) 6425 if (ni == NULL)
6426 return FAIL; 6426 return FAIL;
6427 copy_tv(tv, &ni->li_tv); 6427 copy_tv(tv, &ni->li_tv);
6428 list_insert(l, ni, item);
6429 return OK;
6430 }
6431
6432 void
6433 list_insert(l, ni, item)
6434 list_T *l;
6435 listitem_T *ni;
6436 listitem_T *item;
6437 {
6428 if (item == NULL) 6438 if (item == NULL)
6429 /* Append new item at end of list. */ 6439 /* Append new item at end of list. */
6430 list_append(l, ni); 6440 list_append(l, ni);
6431 else 6441 else
6432 { 6442 {
6444 l->lv_idx_item = NULL; 6454 l->lv_idx_item = NULL;
6445 } 6455 }
6446 item->li_prev = ni; 6456 item->li_prev = ni;
6447 ++l->lv_len; 6457 ++l->lv_len;
6448 } 6458 }
6449 return OK;
6450 } 6459 }
6451 6460
6452 /* 6461 /*
6453 * Extend "l1" with "l2". 6462 * Extend "l1" with "l2".
6454 * If "bef" is NULL append at the end, otherwise insert before this item. 6463 * If "bef" is NULL append at the end, otherwise insert before this item.