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.h | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'vis.h') diff --git a/vis.h b/vis.h index 272df07..72f6ec5 100644 --- a/vis.h +++ b/vis.h @@ -957,20 +957,16 @@ VIS_EXPORT Array vis_mark_get(Win *win, enum VisMark id); */ VIS_EXPORT void vis_mark_normalize(Array *array); /** - * Add selections of focused window to jump list. + * Add selections of focused window to jump list. Equivalent to vis_jumplist(vis, 0). * @param vis The editor instance. */ -VIS_EXPORT void vis_jumplist_save(Vis*); +#define vis_jumplist_save(vis) vis_jumplist((vis), 0) /** - * Navigate jump list backwards. + * Navigate jump list by a specified amount. Wraps if advance exceeds list size. * @param vis The editor instance. + * @param advance The amount to advance the cursor by. 0 saves the current selections. */ -VIS_EXPORT void vis_jumplist_prev(Vis*); -/** - * Navigate jump list forwards. - * @param vis The editor instance. - */ -VIS_EXPORT void vis_jumplist_next(Vis*); +VIS_EXPORT void vis_jumplist(Vis *, int advance); /** @} */ /* -- cgit v1.2.3