aboutsummaryrefslogtreecommitdiff
path: root/helix-term
diff options
context:
space:
mode:
authorPascal Kuthe2023-09-06 14:03:48 +0000
committerGitHub2023-09-06 14:03:48 +0000
commite6cdc5f9d327d30886a8fa2961e7a55b4ca0b692 (patch)
treebbd74e9a7068d6a69f97089e7a22a25d26b9d552 /helix-term
parent0cfd46c14f67351db1e739834f58d8ed15d2bb4d (diff)
Don't use word splitting during fuzzy matching (#8192)
Diffstat (limited to 'helix-term')
-rw-r--r--helix-term/src/ui/menu.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/helix-term/src/ui/menu.rs b/helix-term/src/ui/menu.rs
index 8eeb41ee..9704b1f2 100644
--- a/helix-term/src/ui/menu.rs
+++ b/helix-term/src/ui/menu.rs
@@ -5,7 +5,7 @@ use crate::{
ctrl, key, shift,
};
use helix_core::fuzzy::MATCHER;
-use nucleo::pattern::{AtomKind, CaseMatching, Pattern};
+use nucleo::pattern::{Atom, AtomKind, CaseMatching};
use nucleo::{Config, Utf32Str};
use tui::{buffer::Buffer as Surface, widgets::Table};
@@ -94,13 +94,13 @@ impl<T: Item> Menu<T> {
self.matches.clear();
let mut matcher = MATCHER.lock();
matcher.config = Config::DEFAULT;
- let pattern = Pattern::new(pattern, CaseMatching::Ignore, AtomKind::Fuzzy);
+ let pattern = Atom::new(pattern, CaseMatching::Ignore, AtomKind::Fuzzy, false);
let mut buf = Vec::new();
let matches = self.options.iter().enumerate().filter_map(|(i, option)| {
let text = option.filter_text(&self.editor_data);
pattern
.score(Utf32Str::new(&text, &mut buf), &mut matcher)
- .map(|score| (i as u32, score))
+ .map(|score| (i as u32, score as u32))
});
self.matches.extend(matches);
self.matches