mirror of
https://github.com/bobwen-dev/hunter
synced 2025-04-12 00:55:41 +02:00
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();
|
let mut completion = OsString::new();
|
||||||
if file.file_type()?.is_dir() {
|
if file.file_type()?.is_dir() {
|
||||||
completion.push(prefix.trim_end("/"));
|
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);
|
completion.push(name);
|
||||||
|
|
||||||
|
// Add final slash to directory
|
||||||
|
completion.push("/");
|
||||||
Ok(completion)
|
Ok(completion)
|
||||||
} else {
|
} else {
|
||||||
completion.push(prefix);
|
completion.push(prefix);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user