diff --git a/helix-term/src/ui/prompt.rs b/helix-term/src/ui/prompt.rs index 165d87c79..ef08edf2d 100644 --- a/helix-term/src/ui/prompt.rs +++ b/helix-term/src/ui/prompt.rs @@ -526,6 +526,11 @@ impl Component for Prompt { } key!(Tab) => { self.change_completion_selection(CompletionDirection::Forward); + // if single completion candidate is a directory list content in completion + if self.completion.len() == 1 && self.line.ends_with(std::path::MAIN_SEPARATOR) { + self.recalculate_completion(cx.editor); + self.exit_selection(); + } (self.callback_fn)(cx, &self.line, PromptEvent::Update) } shift!(Tab) => {