From d18836d0bfbf108feb01055dd96ae72dc5c1ce41 Mon Sep 17 00:00:00 2001 From: rabite0 Date: Sat, 29 Feb 2020 03:09:16 +0100 Subject: fix garbage completion with partial directory name and trailing / --- src/minibuffer.rs | 5 +++++ 1 file changed, 5 insertions(+) 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> { 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()?; -- cgit v1.2.3