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.
diff --git a/src/structs.h b/src/structs.h
index e2f1de9..a35361e 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -1464,8 +1464,9 @@
// allowed to mask existing functions
// Values for "v_lock".
-#define VAR_LOCKED 1 // locked with lock(), can use unlock()
-#define VAR_FIXED 2 // locked forever
+#define VAR_LOCKED 1 // locked with lock(), can use unlock()
+#define VAR_FIXED 2 // locked forever
+#define VAR_ITEMS_LOCKED 4 // items of non-materialized list locked
/*
* Structure to hold an item of a list: an internal variable without a name.
@@ -1497,7 +1498,8 @@
*/
struct listvar_S
{
- listitem_T *lv_first; // first item, NULL if none
+ listitem_T *lv_first; // first item, NULL if none, &range_list_item
+ // for a non-materialized list
listwatch_T *lv_watch; // first watcher, NULL if none
union {
struct { // used for non-materialized range list: