vis

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

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

commit 5e3d38534c1937341d5d1f904989ed39de86f1d2
parent b606d69428ef3b20a1a64d96e1b4f7d9e8f66f2c
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Mon, 28 Mar 2016 12:43:57 +0200

vis: cleanup usage of vis_cursors_count

Diffstat:
Mview.c | 2+-
Mvis-prompt.c | 2+-
Mvis.c | 2+-
3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/view.c b/view.c @@ -1105,7 +1105,7 @@ err: int view_cursors_count(View *view) { int i = 0; - for (Cursor *c = view_cursors(view); c; c = view_cursors_next(c)) + for (Cursor *c = view->cursors; c; c = c->next) i++; return i; } diff --git a/vis-prompt.c b/vis-prompt.c @@ -95,7 +95,7 @@ static const char *prompt_enter(Vis *vis, const char *keys, const Arg *arg) { static const char *prompt_esc(Vis *vis, const char *keys, const Arg *arg) { Win *prompt = vis->win; - if (view_cursors_count(prompt->view) > 1) { + if (view_cursors_multiple(prompt->view)) { view_cursors_clear(prompt->view); } else { prompt_restore(prompt); diff --git a/vis.c b/vis.c @@ -432,7 +432,7 @@ void action_do(Vis *vis, Action *a) { int count = MAX(a->count, 1); bool repeatable = a->op && !vis->macro_operator; - bool multiple_cursors = view_cursors_count(view) > 1; + bool multiple_cursors = view_cursors_multiple(view); bool linewise = !(a->type & CHARWISE) && ( a->type & LINEWISE || (a->movement && a->movement->type & LINEWISE) || vis->mode == &vis_modes[VIS_MODE_VISUAL_LINE]);