diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-04-04 13:02:25 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-04-04 13:15:04 +0200 |
| commit | 8f36d16d25bc30fdf4140b7e803608ce9de923b0 (patch) | |
| tree | f6f26b78f8863b97004856a5eb48b916f5a95fda /main.c | |
| parent | 1c1bf5b321f57dd6df728b483a848c6000c9ddb0 (diff) | |
| download | vis-8f36d16d25bc30fdf4140b7e803608ce9de923b0.tar.gz vis-8f36d16d25bc30fdf4140b7e803608ce9de923b0.tar.xz | |
vis: in visual mode allow navigation among cursors using <C-j> and <C-k>
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -1401,8 +1401,12 @@ static const char *cursors_remove(Vis *vis, const char *keys, const Arg *arg) { static const char *cursors_navigate(Vis *vis, const char *keys, const Arg *arg) { View *view = vis_view(vis); - if (!view_cursors_multiple(view)) - return wscroll(vis, keys, arg); + if (!view_cursors_multiple(view)) { + Filerange sel = view_selection_get(view); + if (!text_range_valid(&sel)) + return wscroll(vis, keys, arg); + return keys; + } Cursor *c = view_cursors_primary_get(view); for (int count = vis_count_get_default(vis, 1); count > 0; count--) { if (arg->i > 0) { |
