@@ -1116,9 +1116,10 @@ impl Editor {
11161116 }
11171117
11181118 pub fn close(&mut self, id: ViewId) {
1119− let (_view, doc) = current!(self);
1120− // remove selection
1121− doc.remove_view(id);
1119+ // Remove selections for the closed view on all documents.
1120+ for doc in self.documents_mut() {
1121+ doc.remove_view(id);
1122+ }
11221123 self.tree.remove(id);
11231124 self._refresh();
11241125 }