vis

a vi-like editor based on Plan 9's structural regular expressions

git clone https://9o.is/git/vis.git

commit fbdfdd11a9884cf8761ad368eff0ab0f56011c05
parent 553938c1ed180918682181a0345ef59607848782
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Mon, 12 Jun 2017 18:19:14 +0200

view: rename view_cursors_selection_start

Diffstat:
Msam.c | 6+++---
Mview.c | 2+-
Mview.h | 2+-
Mvis-modes.c | 4++--
4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/sam.c b/sam.c @@ -1213,7 +1213,7 @@ enum SamError sam_cmd(Vis *vis, const char *s) { if (c->cursor) { if (visual) { view_selections_set(c->cursor, &sel); - view_cursors_selection_start(c->cursor); + view_selections_anchor(c->cursor); } else { if (memchr(c->data, '\n', c->len)) view_cursors_to(c->cursor, sel.start); @@ -1224,7 +1224,7 @@ enum SamError sam_cmd(Vis *vis, const char *s) { Cursor *cursor = view_selections_new(c->win->view, sel.start); if (cursor) { view_selections_set(cursor, &sel); - view_cursors_selection_start(cursor); + view_selections_anchor(cursor); } } } @@ -1505,7 +1505,7 @@ static bool cmd_print(Vis *vis, Win *win, Command *cmd, const char *argv[], Curs if (cur) { if (range->start != range->end) { view_selections_set(cur, range); - view_cursors_selection_start(cur); + view_selections_anchor(cur); } else { view_selection_clear(cur); } diff --git a/view.c b/view.c @@ -1161,7 +1161,7 @@ void view_cursors_place(Cursor *c, size_t line, size_t col) { view_cursors_to(c, pos); } -void view_cursors_selection_start(Cursor *c) { +void view_selections_anchor(Cursor *c) { c->anchored = true; } diff --git a/view.h b/view.h @@ -213,7 +213,7 @@ void view_selections_flip(Cursor*); * Anchor selection. * Further updates will only update the cursor, the anchor will remain fixed. */ -void view_cursors_selection_start(Cursor*); +void view_selections_anchor(Cursor*); /** Check whether selection is anchored. */ bool view_selection_anchored(Cursor*); /** Get position of selection cursor. */ diff --git a/vis-modes.c b/vis-modes.c @@ -186,14 +186,14 @@ static void vis_mode_operator_input(Vis *vis, const char *str, size_t len) { static void vis_mode_visual_enter(Vis *vis, Mode *old) { if (!old->visual) { for (Cursor *c = view_cursors(vis->win->view); c; c = view_cursors_next(c)) - view_cursors_selection_start(c); + view_selections_anchor(c); } } static void vis_mode_visual_line_enter(Vis *vis, Mode *old) { if (!old->visual) { for (Cursor *c = view_cursors(vis->win->view); c; c = view_cursors_next(c)) - view_cursors_selection_start(c); + view_selections_anchor(c); } if (!vis->action.op) vis_motion(vis, VIS_MOVE_NOP);