Skip to content

Commit

Permalink
Remove selections for closed views on all documents (helix-editor#4888)
Browse files Browse the repository at this point in the history
Previously we removed selections for a closed view on only the
currently focused document. A view might have selections in other
documents though, so the view needs to be removed from all documents.
  • Loading branch information
the-mikedavis authored and Frederik Vestre committed Feb 6, 2023
1 parent caff7e7 commit 24a643f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions helix-view/src/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1116,9 +1116,10 @@ impl Editor {
}

pub fn close(&mut self, id: ViewId) {
let (_view, doc) = current!(self);
// remove selection
doc.remove_view(id);
// Remove selections for the closed view on all documents.
for doc in self.documents_mut() {
doc.remove_view(id);
}
self.tree.remove(id);
self._refresh();
}
Expand Down

0 comments on commit 24a643f

Please sign in to comment.