diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2017-07-08 12:27:51 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2017-07-08 13:01:34 +0200 |
| commit | 4bbaf4f6aeace4be25089e8b370ecb6944c99523 (patch) | |
| tree | bdba881f239df1d9fecf7af3a213db557104e7a9 | |
| parent | ad10da5cc094204eb6f319841ab73246b689abb4 (diff) | |
| download | vis-4bbaf4f6aeace4be25089e8b370ecb6944c99523.tar.gz vis-4bbaf4f6aeace4be25089e8b370ecb6944c99523.tar.xz | |
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.
| -rw-r--r-- | view.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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; } |
