mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-22 17:36:19 +04:00
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:
parent
4e52d4d6f4
commit
8529d756fa
@ -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();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user