aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--helix-view/src/editor.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs
index 23e0a497..6eaa89aa 100644
--- a/helix-view/src/editor.rs
+++ b/helix-view/src/editor.rs
@@ -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();
}