aboutsummaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authorRandy Palamar <randy@rnpnr.xyz>2025-12-17 16:29:06 -0700
committerRandy Palamar <randy@rnpnr.xyz>2026-01-06 15:38:58 -0700
commit65d0847af82ba6189817dfab4485de111e299634 (patch)
treed4e0d5a3a80a081785445d6d5e5c0adcc7ac3bc2 /array.c
parent9f133c83126c77b05b18e3b3def8a9394d6b42f9 (diff)
downloadvis-65d0847af82ba6189817dfab4485de111e299634.tar.gz
vis-65d0847af82ba6189817dfab4485de111e299634.tar.xz
vis-marks: greatly simplify jumplist management
As far as I could tell from the code this was supposed to be a fixed size LRU cache of sets of selection regions. The structure had a maximum size member but it was never set or used. Furthermore there was some very complicated management of 2 parallel sets of regions. Instead of that mess just treat the cache as a circular buffer. Note that this is really not that useful at the moment. While the selection regions are saved and restored the editor mode is not. Therefore the selection is visible but not in any way usable. That will be fixed in the next commit.
Diffstat (limited to 'array.c')
-rw-r--r--array.c18
1 files changed, 0 insertions, 18 deletions
diff --git a/array.c b/array.c
index a6de4b1..e60b78e 100644
--- a/array.c
+++ b/array.c
@@ -141,21 +141,3 @@ void array_sort(Array *arr, int (*compar)(const void*, const void*)) {
if (arr->items)
qsort(arr->items, arr->len, arr->elem_size, compar);
}
-
-bool array_push(Array *arr, void *item) {
- return array_add(arr, item);
-}
-
-void *array_pop(Array *arr) {
- void *item = array_peek(arr);
- if (!item)
- return NULL;
- arr->len--;
- return item;
-}
-
-void *array_peek(const Array *arr) {
- if (arr->len == 0)
- return NULL;
- return array_get(arr, arr->len - 1);
-}