diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-03-28 11:02:33 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-03-28 12:25:06 +0200 |
| commit | f577616bcefac9480eef5f995bbc589b946e5c6b (patch) | |
| tree | 8f6b008171b2336f36e8725c38e55e4b4e750988 /main.c | |
| parent | 86b1887aac82b86e1f2ad0f255bd872796dd4803 (diff) | |
| download | vis-f577616bcefac9480eef5f995bbc589b946e5c6b.tar.gz vis-f577616bcefac9480eef5f995bbc589b946e5c6b.tar.xz | |
vis: Ctrl-{j,k} do not create duplicate cursors, instead advance primary one
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -1232,7 +1232,14 @@ static const char *cursors_new(Vis *vis, const char *keys, const Arg *arg) { view_line_up(cursor); size_t newpos = view_cursors_pos(cursor); view_cursors_to(cursor, oldpos); - view_cursors_new(view, newpos); + if (!view_cursors_new(view, newpos)) { + if (arg->i == -1) { + cursor = view_cursors_prev(cursor); + } else if (arg->i == +1) { + cursor = view_cursors_next(cursor); + } + view_cursors_primary_set(cursor); + } } vis_count_set(vis, VIS_COUNT_UNKNOWN); return keys; |
