-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How should Nucleo work? #38
Comments
Well, I think the problem is from // Injector<T>
pub fn push(
&self,
value: T,
fill_columns: impl FnOnce(&mut [Utf32String])
) -> u32 I didn't use // Atom/Pattern
pub fn match_list<T>(
&self,
items: impl IntoIterator<Item = T>,
matcher: &mut Matcher
) -> Vec<(T, u16)>
where
T: AsRef<str>, Actually, I indeed noticed And // ...
let list = [
"foobar".to_owned(),
"fxxoo".to_owned(),
"oo".to_owned(),
"a long string".to_owned(),
];
for (idx, item) in list.iter().enumerate() {
inject.push(Idx(idx), |buf| {
dbg!(buf.len());
if let Some(buf) = buf.first_mut() {
*buf = item.as_str().into();
}
});
}
// ...
snapshot
.matched_items(..)
.map(|item| &list[item.data.0])
.collect(); The last thing I don't understand is why the argument in |
Hah, I just realized it's due to
I created a 1 column |
Thanks for creating the fuzzy library.
I encounter a weird problem for Nucleo struct.
For the following code which you can run on rust-explorer
The
res
is always empty:By using
nucleo::Matcher
, for the same config, input and needle string, there is the desired output.So the question is how we use Nucleo in the right way? I see an issue asking for examples, but no replies in there.
I also scan the code in helix's source files, though nucleo is used as its dependency, the real use of it is Matcher, not Nucleo.
The text was updated successfully, but these errors were encountered: