Skip to content

Commit

Permalink
feat: make help items filtering case-insensitive, close #275
Browse files Browse the repository at this point in the history
  • Loading branch information
sxyazi committed Oct 21, 2023
1 parent 89e56cd commit e6fb999
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions config/src/keymap/control.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ impl Control {

#[inline]
pub fn contains(&self, s: &str) -> bool {
self.desc.as_ref().map(|d| d.contains(s)) == Some(true)
|| self.exec().contains(s)
|| self.on().contains(s)
let s = s.to_lowercase();
self.desc.as_ref().map(|d| d.to_lowercase().contains(&s)) == Some(true)
|| self.exec().to_lowercase().contains(&s)
|| self.on().to_lowercase().contains(&s)
}
}

0 comments on commit e6fb999

Please sign in to comment.