Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Fix panic in completions menu

Antonio Scandurraa551647ec1ca
diff --git a/crates/editor2/src/editor.rs b/crates/editor2/src/editor.rs
index f1f053acbb8..943ddf47bda 100644
--- a/crates/editor2/src/editor.rs
+++ b/crates/editor2/src/editor.rs
@@ -1350,15 +1350,15 @@ impl CompletionsMenu {
completion.sort_key(),
)
});
- drop(completions);
for mat in &mut matches {
- let completions = self.completions.read();
- let filter_start = completions[mat.candidate_id].label.filter_range.start;
+ let completion = &completions[mat.candidate_id];
+ mat.string = completion.label.text.clone();
for position in &mut mat.positions {
- *position += filter_start;
+ *position += completion.label.filter_range.start;
}
}
+ drop(completions);
self.matches = matches.into();
self.selected_item = 0;