From d6c4d8b155de16abcfcffa2a9bbfa886909b3ec3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Wed, 5 Jul 2017 10:28:13 +0200 Subject: vis: make sure all selections have same anchored state With the current model the differences between normal and visual mode is that in the latter selections are anchored (meaning one endpoint remains fixed), while in normal mode both endpoints can in principle be updated simultaneously (currently they are always colapsed to a singleton selection, giving the impression of cursors). --- view.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'view.c') diff --git a/view.c b/view.c index 40ae9f1..e1a6c5e 100644 --- a/view.c +++ b/view.c @@ -1252,7 +1252,7 @@ bool view_regions_save(View *view, Filerange *r, SelectionRegion *s) { return true; } -void view_selections_set_all(View *view, Array *arr) { +void view_selections_set_all(View *view, Array *arr, bool anchored) { Selection *s; Filerange *r; size_t i = 0; @@ -1264,11 +1264,13 @@ void view_selections_set_all(View *view, Array *arr) { } break; } + s->anchored = anchored; } while ((r = array_get(arr, i++))) { s = view_selections_new_force(view, r->start); if (!s || !view_selections_set(s, r)) break; + s->anchored = anchored; } view_selections_primary_set(view->selections); } -- cgit v1.2.3