From 4bbaf4f6aeace4be25089e8b370ecb6944c99523 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sat, 8 Jul 2017 12:27:51 +0200 Subject: view: keep but clear primary selection if instructed to replace all Previously the last selection was kept implicitly to statisfy the invariant that at least one selection needs to exist. --- view.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'view.c') diff --git a/view.c b/view.c index e1a6c5e..557a758 100644 --- a/view.c +++ b/view.c @@ -1260,7 +1260,10 @@ void view_selections_set_all(View *view, Array *arr, bool anchored) { if (!(r = array_get(arr, i++)) || !view_selections_set(s, r)) { for (Selection *next; s; s = next) { next = view_selections_next(s); - view_selections_dispose(s); + if (i == 1 && s == view->selection) + view_selection_clear(s); + else + view_selections_dispose(s); } break; } -- cgit v1.2.3