on master help sign in
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.

commit8529d756fad2eeea543b487e1ff5253857bc2e16 authorMichael Davis <mcarsondavis@gmail.com> dateFri 25 Nov 2022, 20:52 (4 years ago) parent4e52d4d
1 file changed+4−3
helix-view/src/editor.rs+4−3
helix-view/src/editor.rs+4−3
@@ -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 }