diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs index e86fba6529cc..a57e7da9cdd4 100644 --- a/helix-view/src/editor.rs +++ b/helix-view/src/editor.rs @@ -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(); }