1
0
forked from aniani/vim

patch 8.2.4225: Vim9: depth argument of :lockvar not parsed in :def function

Problem:    Vim9: depth argument of :lockvar not parsed in :def function.
Solution:   Parse the optional depth argument. (closes #9629)
            Fix that locking doesn't work for a non-materialize list.
This commit is contained in:
Bram Moolenaar
2022-01-26 21:01:15 +00:00
parent 1080c48ec8
commit 70c43d84be
9 changed files with 82 additions and 18 deletions

View File

@@ -7922,7 +7922,7 @@ range_list_materialize(list_T *list)
{
varnumber_T start = list->lv_u.nonmat.lv_start;
varnumber_T end = list->lv_u.nonmat.lv_end;
int stride = list->lv_u.nonmat.lv_stride;
int stride = list->lv_u.nonmat.lv_stride;
varnumber_T i;
list->lv_first = NULL;
@@ -7930,8 +7930,13 @@ range_list_materialize(list_T *list)
list->lv_len = 0;
list->lv_u.mat.lv_idx_item = NULL;
for (i = start; stride > 0 ? i <= end : i >= end; i += stride)
{
if (list_append_number(list, (varnumber_T)i) == FAIL)
break;
if (list->lv_lock & VAR_ITEMS_LOCKED)
list->lv_u.mat.lv_last->li_tv.v_lock = VAR_LOCKED;
}
list->lv_lock &= ~VAR_ITEMS_LOCKED;
}
/*