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 Shekhinah Memmel committed Dec 11, 2022
1 parent eb8ae0f commit c3b7542
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 @@ -1182,9 +1182,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 c3b7542

Please sign in to comment.