From 40a61e7e68a614307f2e881cd9388b175949ace4 Mon Sep 17 00:00:00 2001 From: Justine Date: Mon, 20 Feb 2023 14:12:25 +0100 Subject: [PATCH] Autocomplete is now case insensitive --- src/shell/autocomplete.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shell/autocomplete.rs b/src/shell/autocomplete.rs index cd52a3c..d14913d 100644 --- a/src/shell/autocomplete.rs +++ b/src/shell/autocomplete.rs @@ -149,7 +149,7 @@ fn autocomplete_file(search: &Search) -> std::io::Result<(String, String)> { .unwrap() .to_str() .unwrap(); - let re = format!("^{}.*$", search.searchee); + let re = format!("(?i)^{}.*$", search.searchee); let regex = Regex::new(&re).unwrap(); if regex.is_match(filename) { if search.local_search { @@ -250,7 +250,7 @@ fn autocomplete_cmd(input: &String, search: &Search) -> (String, String) { ///Takes a string and returns a Vector of PathBuf containing all matchings ///commands fn find_bin(command: &String) -> Vec { - let re = format!("^{}.*", command); + let re = format!("(?i)^{}.*", command); let re = Regex::new(&re).unwrap(); let mut binaries: Vec = which_re(re).unwrap().collect(); binaries.sort();