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
+1 -1
View File
@@ -416,7 +416,7 @@ impl Item for TextDiffView {
pub fn selection_location_text(editor: &Editor, cx: &App) -> Option<String> {
let buffer = editor.buffer().read(cx);
let buffer_snapshot = buffer.snapshot(cx);
let first_selection = editor.selections.disjoint.first()?;
let first_selection = editor.selections.disjoint_anchors().first()?;
let selection_start = first_selection.start.to_point(&buffer_snapshot);
let selection_end = first_selection.end.to_point(&buffer_snapshot);