From 6ced61ef5f366001877823ed8aff978035fa53c8 Mon Sep 17 00:00:00 2001 From: Randy Palamar Date: Wed, 17 Dec 2025 17:19:10 -0700 Subject: vis-marks: make mark set cache actually useful Without also saving and restoring the editor mode when the selections were added to the cache almost no useful actions can be performed. While we are at it the 3 jumplist functions can just be combined into one. --- vis-core.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'vis-core.h') diff --git a/vis-core.h b/vis-core.h index 6e601ab..82e684a 100644 --- a/vis-core.h +++ b/vis-core.h @@ -161,9 +161,18 @@ struct Win { Mode *parent_mode; /* mode which was active when showing the command prompt */ Win *prev, *next; /* neighbouring windows */ - /* Jumplist LRU */ - size_t mark_set_lru_cursor; - Array mark_set_lru[32]; + /* NOTE: Selection Jump Cache + * Anytime the selection jumps the previous set of selections gets + * pushed into this cache. The user can navigate this cache to + * restore old selections and they can save their own selection + * sets into the cache. + * + * IMPORTANT: cursor is not kept in bounds. it is always used modulo VIS_MARK_SET_LRU_COUNT + */ + #define VIS_MARK_SET_LRU_COUNT (32) + size_t mark_set_lru_cursor; + Array mark_set_lru_regions[VIS_MARK_SET_LRU_COUNT]; + enum VisMode mark_set_lru_modes[VIS_MARK_SET_LRU_COUNT]; }; struct Vis { -- cgit v1.2.3