Skip to content

Commit

Permalink
view: rename view_cursors_selection_start
Browse files Browse the repository at this point in the history
  • Loading branch information
martanne committed Jun 15, 2017
1 parent b823826 commit 2b472ce
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions sam.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
}
}
}
Expand Down Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion view.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion view.h
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
4 changes: 2 additions & 2 deletions vis-modes.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2b472ce

Please sign in to comment.