diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-03-27 16:14:48 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-03-28 12:25:05 +0200 |
| commit | 8965cd21386683cae680ba7de4b6a6ee6687e17f (patch) | |
| tree | b4920c2958069cff877a778bf0dbf3e8578e71a9 /vis-operators.c | |
| parent | f567d332bec0e7d31b7214e4065663e5349b2252 (diff) | |
| download | vis-8965cd21386683cae680ba7de4b6a6ee6687e17f.tar.gz vis-8965cd21386683cae680ba7de4b6a6ee6687e17f.tar.xz | |
view: change cursor creation API to take an initial position
Diffstat (limited to 'vis-operators.c')
| -rw-r--r-- | vis-operators.c | 15 |
1 files changed, 6 insertions, 9 deletions
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; } |
