mirror of https://github.com/bobwen-dev/hunter
fix prepended "/" when completing directory
This commit is contained in:
parent
80678fb1f4
commit
853cf534a7
|
@ -409,8 +409,15 @@ pub fn find_files(comp_name: &str) -> HResult<Vec<OsString>> {
|
|||
let mut completion = OsString::new();
|
||||
if file.file_type()?.is_dir() {
|
||||
completion.push(prefix.trim_end("/"));
|
||||
completion.push("/");
|
||||
|
||||
// When completing something in the curren dir this will be empty
|
||||
if completion != "" {
|
||||
completion.push("/");
|
||||
}
|
||||
completion.push(name);
|
||||
|
||||
// Add final slash to directory
|
||||
completion.push("/");
|
||||
Ok(completion)
|
||||
} else {
|
||||
completion.push(prefix);
|
||||
|
|
Loading…
Reference in New Issue