patch 8.2.2533: Vim9: cannot use a range with :unlet
Problem: Vim9: cannot use a range with :unlet.
Solution: Implement ISN_UNLETRANGE.
diff --git a/src/list.c b/src/list.c
index 484ce74..2af3085 100644
--- a/src/list.c
+++ b/src/list.c
@@ -531,6 +531,26 @@
}
/*
+ * Like list_find() but when a negative index is used that is not found use
+ * zero and set "idx" to zero. Used for first index of a range.
+ */
+ listitem_T *
+list_find_index(list_T *l, long *idx)
+{
+ listitem_T *li = list_find(l, *idx);
+
+ if (li == NULL)
+ {
+ if (*idx < 0)
+ {
+ *idx = 0;
+ li = list_find(l, *idx);
+ }
+ }
+ return li;
+}
+
+/*
* Locate "item" list "l" and return its index.
* Returns -1 when "item" is not in the list.
*/