diff --git a/src/shell/autocomplete.rs b/src/shell/autocomplete.rs index 71e1eb3..d2e6376 100644 --- a/src/shell/autocomplete.rs +++ b/src/shell/autocomplete.rs @@ -94,7 +94,8 @@ impl Search { } }; - if !&self.local_search { + let xxx = &self.search_path.clone().into_os_string().into_string().unwrap(); + if !&self.local_search && !res.contains(&xxx.as_str()) { let return_val = format!("{} {}{}", &self.command, &self.search_path.display(), res); return(return_val, res_lines); } else { @@ -162,15 +163,7 @@ fn autocomplete_file(search: &Search) -> std::io::Result<(String, String)> { *&mut ending.push_str("/"); } - if !search.local_search { - *&mut last_found = format!("{}{}", - filename, - ending); - } else { - *&mut last_found = format!("{}{}", - filename, - ending); - } + *&mut last_found = format!("{}{}", filename, ending); } } //Found one or zero, use what has been found directly