vis

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

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

commit c782d53127a00d23c3fd5fef095bce5dfd146808
parent 726060c1f31a77a27354233e88cfeedbe5b0664f
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Mon, 12 Jun 2017 18:26:09 +0200

view: rename view_cursors_prev

Diffstat:
Mmain.c | 4++--
Mview.c | 2+-
Mview.h | 2+-
Mvis.c | 2+-
4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/main.c b/main.c @@ -1270,7 +1270,7 @@ static const char *cursors_new(Vis *vis, const char *keys, const Arg *arg) { Cursor *cursor_new = view_selections_new(view, newpos); if (!cursor_new) { if (arg->i == -1) - cursor_new = view_cursors_prev(cursor); + cursor_new = view_selections_prev(cursor); else if (arg->i == +1) cursor_new = view_cursors_next(cursor); } @@ -1473,7 +1473,7 @@ static const char *cursors_navigate(Vis *vis, const char *keys, const Arg *arg) if (!c) c = view_cursors(view); } else { - c = view_cursors_prev(c); + c = view_selections_prev(c); if (!c) { c = view_cursors(view); for (Cursor *n = c; n; n = view_cursors_next(n)) diff --git a/view.c b/view.c @@ -1063,7 +1063,7 @@ void view_selections_primary_set(Cursor *c) { c->view->cursor = c; } -Cursor *view_cursors_prev(Cursor *c) { +Cursor *view_selections_prev(Cursor *c) { View *view = c->view; for (c = c->prev; c; c = c->prev) { if (c->generation != view->cursor_generation) diff --git a/view.h b/view.h @@ -148,7 +148,7 @@ void view_selections_primary_set(Cursor*); /** Get first selection. */ Cursor *view_cursors(View*); /** Get immediate predecessor of selection. */ -Cursor *view_cursors_prev(Cursor*); +Cursor *view_selections_prev(Cursor*); /** Get immediate successor of selection. */ Cursor *view_cursors_next(Cursor*); /** diff --git a/vis.c b/vis.c @@ -403,7 +403,7 @@ static void window_draw_cursors(Win *win) { CellStyle style_cursor = win->ui->style_get(win->ui, UI_STYLE_CURSOR); CellStyle style_cursor_primary = win->ui->style_get(win->ui, UI_STYLE_CURSOR_PRIMARY); CellStyle style_selection = win->ui->style_get(win->ui, UI_STYLE_SELECTION); - for (Cursor *c = view_cursors_prev(cursor); c; c = view_cursors_prev(c)) { + for (Cursor *c = view_selections_prev(cursor); c; c = view_selections_prev(c)) { window_draw_selection(win->view, c, &style_selection); size_t pos = view_cursors_pos(c); if (pos < viewport.start)