Fixed additionnal space in command autocomplete

This commit is contained in:
Justine 2023-02-04 23:45:43 +01:00
parent b31e3d4be4
commit 90640d4e51

View File

@ -94,13 +94,20 @@ impl 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 {
let return_val = format!("{} {}", &self.command, res);
return(return_val, res_lines);
match &self.search_type {
SearchType::FileSearch => {
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 {
let return_val = format!("{} {}", &self.command, res);
return(return_val, res_lines);
}
},
SearchType::CmdSearch => {
return (res, res_lines);
},
}
}