Skip to content

Commit

Permalink
view: keep but clear primary selection if instructed to replace all
Browse files Browse the repository at this point in the history
Previously the last selection was kept implicitly to statisfy the invariant
that at least one selection needs to exist.
  • Loading branch information
martanne committed Jul 8, 2017
1 parent ad10da5 commit 4bbaf4f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion view.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 4bbaf4f

Please sign in to comment.