aboutsummaryrefslogtreecommitdiff
path: root/vis-motions.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-motions.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-motions.c')
-rw-r--r--vis-motions.c31
1 files changed, 0 insertions, 31 deletions
diff --git a/vis-motions.c b/vis-motions.c
index b07585b..5b55288 100644
--- a/vis-motions.c
+++ b/vis-motions.c
@@ -107,19 +107,6 @@ static size_t longword_next(Vis *vis, Text *txt, size_t pos) {
return common_word_next(vis, txt, pos, VIS_MOVE_LONGWORD_END_NEXT);
}
-static size_t mark_goto(Vis *vis, File *file, Selection *sel) {
- Array *marks = &file->marks[vis->action.mark];
- size_t idx = view_selections_number(sel);
- SelectionRegion *sr = array_get(marks, idx);
- if (!sr)
- return EPOS;
- return text_mark_get(file->text, sr->cursor);
-}
-
-static size_t mark_line_goto(Vis *vis, File *file, Selection *sel) {
- return text_line_start(file->text, mark_goto(vis, file, sel));
-}
-
static size_t to(Vis *vis, Text *txt, size_t pos) {
char c;
if (pos == text_line_end(txt, pos))
@@ -394,16 +381,6 @@ bool vis_motion(Vis *vis, enum VisMotion motion, ...) {
goto err;
}
break;
- case VIS_MOVE_MARK:
- case VIS_MOVE_MARK_LINE:
- {
- int mark = va_arg(ap, int);
- if (VIS_MARK_a <= mark && mark < VIS_MARK_INVALID)
- vis->action.mark = mark;
- else
- goto err;
- break;
- }
default:
break;
}
@@ -605,14 +582,6 @@ const Movement vis_motions[] = {
.vis = till,
.type = INCLUSIVE|COUNT_EXACT,
},
- [VIS_MOVE_MARK] = {
- .file = mark_goto,
- .type = JUMP|IDEMPOTENT,
- },
- [VIS_MOVE_MARK_LINE] = {
- .file = mark_line_goto,
- .type = LINEWISE|JUMP|IDEMPOTENT,
- },
[VIS_MOVE_SEARCH_WORD_FORWARD] = {
.vis = search_word_forward,
.type = JUMP,