diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2015-11-27 13:26:42 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2015-11-27 13:28:42 +0100 |
| commit | 28481439c06780e2c56d3c2b47711785bcaa25a6 (patch) | |
| tree | 94c1d4cb07e607cafc14bd5ef588138eabf871fb /main.c | |
| parent | 7ce4e0cc1423bb55f798031014462fd192d23fc3 (diff) | |
| download | vis-28481439c06780e2c56d3c2b47711785bcaa25a6.tar.gz vis-28481439c06780e2c56d3c2b47711785bcaa25a6.tar.xz | |
vis: improve creation of new cursors on line above/below
Use view cell matrix data to create the cursors on more appropriate
positions.
Closes #108
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -1110,15 +1110,15 @@ static const char *repeat(Vis *vis, const char *keys, const Arg *arg) { static const char *cursors_new(Vis *vis, const char *keys, const Arg *arg) { View *view = vis_view(vis); - Text *txt = vis_text(vis); size_t pos = view_cursor_get(view); - if (arg->i > 0) - pos = text_line_down(txt, pos); - else if (arg->i < 0) - pos = text_line_up(txt, pos); Cursor *cursor = view_cursors_new(view); - if (cursor) + if (cursor) { view_cursors_to(cursor, pos); + if (arg->i > 0) + view_line_down(cursor); + else if (arg->i < 0) + view_line_up(cursor); + } return keys; } |
