vim-patch:8.2.0987: Vim9: cannot assign to [var; var]

Problem:    Vim9: cannot assign to [var; var].
Solution:   Assign rest of items to a list.

9af78769ee

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
zeertzjq
2023-05-04 13:54:55 +08:00
parent 24d4a82569
commit 1659cd15be
2 changed files with 12 additions and 9 deletions

View File

@@ -765,6 +765,17 @@ int tv_list_concat(list_T *const l1, list_T *const l2, typval_T *const tv)
return OK;
}
list_T *tv_list_slice(list_T *ol, int n1, int n2)
{
list_T *l = tv_list_alloc(n2 - n1 + 1);
listitem_T *item = tv_list_find(ol, n1);
for (; n1 <= n2; n1++) {
tv_list_append_tv(l, TV_LIST_ITEM_TV(item));
item = TV_LIST_ITEM_NEXT(rettv->vval.v_list, item);
}
return l;
}
typedef struct {
char *s;
char *tofree;