mirror of https://github.com/bobwen-dev/hunter
fix garbage completion with partial directory name and trailing /
This commit is contained in:
parent
853cf534a7
commit
d18836d0bf
|
@ -392,6 +392,11 @@ pub fn find_files(comp_name: &str) -> HResult<Vec<OsString>> {
|
|||
let comp_path = std::path::PathBuf::from(&comp_name);
|
||||
path.push(&comp_path);
|
||||
|
||||
// Tried to complete on an incorrect path
|
||||
if comp_name.ends_with("/") && !path.is_dir() {
|
||||
return Err(HError::NoCompletionsError)
|
||||
}
|
||||
|
||||
let comp_name = OsStr::new(comp_name);
|
||||
let filename_part = path.file_name()?;
|
||||
|
||||
|
|
Loading…
Reference in New Issue