mirror of
https://github.com/nushell/nushell.git
synced 2025-08-15 19:57:52 +02:00
Take positional into account
This commit is contained in:
@ -77,12 +77,15 @@ impl<T> NuMatcher<T> {
|
|||||||
} else {
|
} else {
|
||||||
Cow::Owned(haystack.to_folded_case())
|
Cow::Owned(haystack.to_folded_case())
|
||||||
};
|
};
|
||||||
if haystack_lowercased.starts_with(self.needle.as_str()) {
|
let matches = if self.options.positional {
|
||||||
items.push((haystack, item));
|
haystack_lowercased.starts_with(self.needle.as_str())
|
||||||
true
|
|
||||||
} else {
|
} else {
|
||||||
false
|
haystack_lowercased.contains(self.needle.as_str())
|
||||||
|
};
|
||||||
|
if matches {
|
||||||
|
items.push((haystack, item));
|
||||||
}
|
}
|
||||||
|
matches
|
||||||
}
|
}
|
||||||
State::Fuzzy { items } => {
|
State::Fuzzy { items } => {
|
||||||
let mut matcher = SkimMatcherV2::default();
|
let mut matcher = SkimMatcherV2::default();
|
||||||
|
Reference in New Issue
Block a user