Remove selections for closed views on all documents (#4888)

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.
This commit is contained in:
Michael Davis 2022-11-25 20:52:22 -06:00 committed by GitHub
parent 4e52d4d6f4
commit 8529d756fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1116,9 +1116,10 @@ pub fn open(&mut self, path: &Path, action: Action) -> Result<DocumentId, Error>
} }
pub fn close(&mut self, id: ViewId) { pub fn close(&mut self, id: ViewId) {
let (_view, doc) = current!(self); // Remove selections for the closed view on all documents.
// remove selection for doc in self.documents_mut() {
doc.remove_view(id); doc.remove_view(id);
}
self.tree.remove(id); self.tree.remove(id);
self._refresh(); self._refresh();
} }