aboutsummaryrefslogtreecommitdiff
path: root/vis.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2017-07-08 09:52:56 +0200
committerMarc André Tanner <mat@brain-dump.org>2017-07-08 09:52:56 +0200
commitad10da5cc094204eb6f319841ab73246b689abb4 (patch)
tree9493aadbf020088befc922d61187c80c72f0f2dc /vis.c
parent5c600e15c1c1ab64f385de918c93d2bdb23955d5 (diff)
downloadvis-ad10da5cc094204eb6f319841ab73246b689abb4.tar.gz
vis-ad10da5cc094204eb6f319841ab73246b689abb4.tar.xz
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.
Diffstat (limited to 'vis.c')
-rw-r--r--vis.c17
1 files changed, 1 insertions, 16 deletions
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;
}