mirror of https://github.com/helix-editor/helix
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.pull/4896/head
parent
4e52d4d6f4
commit
8529d756fa
|
@ -1116,9 +1116,10 @@ impl Editor {
|
||||||
}
|
}
|
||||||
|
|
||||||
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();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue