diff --git a/src/roftl.rs b/src/roftl.rs index 0b0c47d..69f6487 100644 --- a/src/roftl.rs +++ b/src/roftl.rs @@ -86,6 +86,10 @@ impl Roftl { } pub fn narrow(&mut self, input: &str) -> Vec<(&Entry, Vec)> { + let mut completions = std::collections::HashMap::new(); + completions.insert("e", "emacs"); + completions.insert("f", "firefox"); + let mut scored_entries: Vec<(f64, usize, &Entry, Vec)> = self.entries .par_iter() .enumerate() @@ -94,6 +98,8 @@ impl Roftl { if input.is_empty() { return Some((0.0, idx, entry, vec![])) } + let input = completions.get(input).unwrap_or(&input); + let match_result = self.primary_matcher.try_match(&entry.name, input); return match_result.map(|(score, indices)| (score, idx, entry, indices) ) })