aboutsummaryrefslogtreecommitdiff
path: root/view.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2017-07-05 10:28:13 +0200
committerMarc André Tanner <mat@brain-dump.org>2017-07-05 10:49:45 +0200
commitd6c4d8b155de16abcfcffa2a9bbfa886909b3ec3 (patch)
tree8a5c1f3a399b16df9f37f8bfcb236bfee48d6e69 /view.c
parent9b6f9c6fa71132506bc509a62b8f262a40a11700 (diff)
downloadvis-d6c4d8b155de16abcfcffa2a9bbfa886909b3ec3.tar.gz
vis-d6c4d8b155de16abcfcffa2a9bbfa886909b3ec3.tar.xz
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).
Diffstat (limited to 'view.c')
-rw-r--r--view.c4
1 files changed, 3 insertions, 1 deletions
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);
}