mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
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:
@@ -2060,10 +2060,18 @@ item_lock(typval_T *tv, int deep, int lock, int check_refcount)
|
||||
l->lv_lock |= VAR_LOCKED;
|
||||
else
|
||||
l->lv_lock &= ~VAR_LOCKED;
|
||||
if ((deep < 0 || deep > 1) && l->lv_first != &range_list_item)
|
||||
// recursive: lock/unlock the items the List contains
|
||||
FOR_ALL_LIST_ITEMS(l, li)
|
||||
item_lock(&li->li_tv, deep - 1, lock, check_refcount);
|
||||
if (deep < 0 || deep > 1)
|
||||
{
|
||||
if (l->lv_first == &range_list_item)
|
||||
l->lv_lock |= VAR_ITEMS_LOCKED;
|
||||
else
|
||||
{
|
||||
// recursive: lock/unlock the items the List contains
|
||||
CHECK_LIST_MATERIALIZE(l);
|
||||
FOR_ALL_LIST_ITEMS(l, li) item_lock(&li->li_tv,
|
||||
deep - 1, lock, check_refcount);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case VAR_DICT:
|
||||
|
Reference in New Issue
Block a user