From 8f36d16d25bc30fdf4140b7e803608ce9de923b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Mon, 4 Apr 2016 13:02:25 +0200 Subject: vis: in visual mode allow navigation among cursors using and --- config.def.h | 2 ++ main.c | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/config.def.h b/config.def.h index c29ce64..0af24fd 100644 --- a/config.def.h +++ b/config.def.h @@ -273,6 +273,8 @@ static const KeyBinding bindings_visual[] = { { "", ALIAS("") }, { "", ACTION(CURSORS_PREV) }, { "", ACTION(CURSORS_NEXT) }, + { "", ALIAS("") }, + { "", ALIAS("") }, { "x", ALIAS("d") }, { "r", ALIAS("c") }, { "s", ALIAS("c") }, diff --git a/main.c b/main.c index 9208974..e8c008a 100644 --- a/main.c +++ b/main.c @@ -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) { -- cgit v1.2.3