editor: Fix unwrap_syntax_node panicking by not setting selections (#38329)

Fixes ZED-11T

Release Notes:

- N/A *or* Added/Fixed/Improved ...
This commit is contained in:
Lukas Wirth
2025-09-17 15:10:05 +00:00
committed by GitHub
parent 0f6dd84c98
commit f3b8c619e3
16 changed files with 112 additions and 85 deletions
+2 -2
View File
@@ -477,7 +477,7 @@ impl TextThreadEditor {
return;
}
let selections = self.editor.read(cx).selections.disjoint_anchors();
let selections = self.editor.read(cx).selections.disjoint_anchors_arc();
let mut commands_by_range = HashMap::default();
let workspace = self.workspace.clone();
self.context.update(cx, |context, cx| {
@@ -1823,7 +1823,7 @@ impl TextThreadEditor {
fn split(&mut self, _: &Split, _window: &mut Window, cx: &mut Context<Self>) {
self.context.update(cx, |context, cx| {
let selections = self.editor.read(cx).selections.disjoint_anchors();
let selections = self.editor.read(cx).selections.disjoint_anchors_arc();
for selection in selections.as_ref() {
let buffer = self.editor.read(cx).buffer().read(cx).snapshot(cx);
let range = selection