diff options
| author | Randy Palamar <randy@rnpnr.xyz> | 2025-12-17 17:19:10 -0700 |
|---|---|---|
| committer | Randy Palamar <randy@rnpnr.xyz> | 2026-01-06 15:54:04 -0700 |
| commit | 6ced61ef5f366001877823ed8aff978035fa53c8 (patch) | |
| tree | 23487e77c00326e6fca9bb31beb4aff0ede92f14 /vis-core.h | |
| parent | 65d0847af82ba6189817dfab4485de111e299634 (diff) | |
| download | vis-6ced61ef5f366001877823ed8aff978035fa53c8.tar.gz vis-6ced61ef5f366001877823ed8aff978035fa53c8.tar.xz | |
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.
Diffstat (limited to 'vis-core.h')
| -rw-r--r-- | vis-core.h | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -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 { |
