From ad10da5cc094204eb6f319841ab73246b689abb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sat, 8 Jul 2017 09:52:56 +0200 Subject: vis: cleanup marks implementation We now use ' to refer to marks. Mark a is set using 'am and restored using 'aM while this is slightly harder to type than ma and 'a it is consistent with register usage for yank/put and allows a default mark to be used which is handy for quick selection manipulation primitives. --- vis.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'vis.c') diff --git a/vis.c b/vis.c index 5424f40..cc09455 100644 --- a/vis.c +++ b/vis.c @@ -28,11 +28,6 @@ #include "vis-core.h" #include "sam.h" -const MarkDef vis_marks[] = { - [VIS_MARK_DEFAULT] = { '"', VIS_HELP("Default mark") }, - [VIS_MARK_SELECTION] = { '^', VIS_HELP("Last selections") }, -}; - static void macro_replay(Vis *vis, const Macro *macro); static void macro_replay_internal(Vis *vis, const Macro *macro); static void vis_keys_push(Vis *vis, const char *input, size_t pos, bool record); @@ -252,7 +247,7 @@ void window_selection_save(Win *win) { Vis *vis = win->vis; View *view = win->view; Array sel = view_selections_get_all(view); - vis_register_selections_set(vis, VIS_REG_SELECTION, &sel); + vis_mark_set(vis, VIS_MARK_SELECTION, &sel); array_release(&sel); } @@ -1533,16 +1528,6 @@ void vis_repeat(Vis *vis) { vis_file_snapshot(vis, vis->win->file); } -enum VisMark vis_mark_from(Vis *vis, char mark) { - if (mark >= 'a' && mark <= 'z') - return VIS_MARK_a + mark - 'a'; - for (size_t i = 0; i < LENGTH(vis_marks); i++) { - if (vis_marks[i].name == mark) - return i; - } - return VIS_MARK_INVALID; -} - int vis_count_get(Vis *vis) { return vis->action.count; } -- cgit v1.2.3