summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrabite0 <rabite@posteo.de>2020-02-29 02:34:11 +0100
committerrabite0 <rabite@posteo.de>2020-02-29 02:34:11 +0100
commit853cf534a7a291a5c03ea0e7d4889717a16616d2 (patch)
treefbc558146152c75618a4d9f9a0fc3f2b5f2c8350
parent80678fb1f4313455459dcd642bfaf75297e20fb6 (diff)
fix prepended "/" when completing directory
-rw-r--r--src/minibuffer.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/minibuffer.rs b/src/minibuffer.rs
index d6d4e47..8771d54 100644
--- a/src/minibuffer.rs
+++ b/src/minibuffer.rs
@@ -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);