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.

editor: Use completion filter_range for fuzzy matching (#20869)

Piotr Osiewicz5c6565a9e0d1
diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs
index 6167c24bff4..d303ecf0f39 100644
--- a/crates/editor/src/editor.rs
+++ b/crates/editor/src/editor.rs
@@ -1036,7 +1036,12 @@ impl CompletionsMenu {
let match_candidates = completions
.iter()
.enumerate()
- .map(|(id, completion)| StringMatchCandidate::new(id, completion.label.text.clone()))
+ .map(|(id, completion)| {
+ StringMatchCandidate::new(
+ id,
+ completion.label.text[completion.label.filter_range.clone()].into(),
+ )
+ })
.collect();
Self {