Skip to content

Commit 8529d75

Browse files
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.
1 parent 4e52d4d commit 8529d75

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

helix-view/src/editor.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

0 commit comments

Comments
 (0)