diff options
author | rabite0 <rabite@posteo.de> | 2020-02-29 03:09:16 +0100 |
---|---|---|
committer | rabite0 <rabite@posteo.de> | 2020-02-29 03:09:16 +0100 |
commit | d18836d0bfbf108feb01055dd96ae72dc5c1ce41 (patch) | |
tree | 780786ef1b402fcb377aa65101259a4940d2cb27 | |
parent | 853cf534a7a291a5c03ea0e7d4889717a16616d2 (diff) |
fix garbage completion with partial directory name and trailing /
-rw-r--r-- | src/minibuffer.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/minibuffer.rs b/src/minibuffer.rs index 8771d54..12cd900 100644 --- a/src/minibuffer.rs +++ b/src/minibuffer.rs @@ -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()?; |