diff --git a/src/shell/autocomplete.rs b/src/shell/autocomplete.rs index aad587d..4e9f50e 100644 --- a/src/shell/autocomplete.rs +++ b/src/shell/autocomplete.rs @@ -86,13 +86,18 @@ impl Search { ///Performs the search and returns (most likely result, result lines to display) ///A found file is preferred to a found command pub fn autocomplete(&self) -> (String, String) { - let (res, res_lines) = match &self.search_type { + let (mut res, res_lines) = match &self.search_type { SearchType::CmdSearch => autocomplete_cmd(&self.searchee), SearchType::FileSearch => match autocomplete_file(&self) { Ok(t) => t, Err(_) => (String::new(), String::new()), } }; + + if res.len() < 1 { + *&mut res = format!("{} {}", &self.command, &self.searchee); + } + return (res, res_lines); }