mirror of
https://github.com/icewind1991/zox
synced 2026-06-03 18:34:07 +02:00
case insentive
This commit is contained in:
parent
b783a8792d
commit
fcb489462f
1 changed files with 5 additions and 2 deletions
|
|
@ -61,7 +61,9 @@ impl History {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn matches(&self, pattern: &[String]) -> bool {
|
pub fn matches(&self, pattern: &[String]) -> bool {
|
||||||
pattern.iter().all(|pat| self.path.contains(pat))
|
pattern
|
||||||
|
.iter()
|
||||||
|
.all(|pat| self.path.to_lowercase().contains(pat))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_sort(&self, sort: SortBy, current_time: u64) -> f64 {
|
pub fn get_sort(&self, sort: SortBy, current_time: u64) -> f64 {
|
||||||
|
|
@ -168,7 +170,8 @@ fn main() -> Result<(), MainError> {
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Ok(history) = history_result {
|
if let Ok(history) = history_result {
|
||||||
let matches = history.filter(|item| item.matches(&args.filter));
|
let filter: Vec<String> = args.filter.iter().map(|s| s.to_lowercase()).collect();
|
||||||
|
let matches = history.filter(|item| item.matches(&filter));
|
||||||
|
|
||||||
let mut matches: Vec<History> = matches.collect();
|
let mut matches: Vec<History> = matches.collect();
|
||||||
matches.sort_by(
|
matches.sort_by(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue