From 8965cd21386683cae680ba7de4b6a6ee6687e17f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sun, 27 Mar 2016 16:14:48 +0200 Subject: view: change cursor creation API to take an initial position --- vis-operators.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'vis-operators.c') diff --git a/vis-operators.c b/vis-operators.c index f9e2ec9..0be30ad 100644 --- a/vis-operators.c +++ b/vis-operators.c @@ -169,15 +169,12 @@ static size_t op_cursor(Vis *vis, Text *txt, OperatorContext *c) { View *view = vis->win->view; Filerange r = text_range_linewise(txt, &c->range); for (size_t line = text_range_line_first(txt, &r); line != EPOS; line = text_range_line_next(txt, &r, line)) { - Cursor *cursor = view_cursors_new(view); - if (cursor) { - size_t pos; - if (c->arg->i == VIS_OP_CURSOR_EOL) - pos = text_line_finish(txt, line); - else - pos = text_line_start(txt, line); - view_cursors_to(cursor, pos); - } + size_t pos; + if (c->arg->i == VIS_OP_CURSOR_EOL) + pos = text_line_finish(txt, line); + else + pos = text_line_start(txt, line); + view_cursors_new(view, pos); } return EPOS; } -- cgit v1.2.3