From 817a7e0bd68c2430e5dcb7b6c612043329a62231 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Fri, 23 Jul 2021 18:10:30 +0900 Subject: [PATCH] fix: Only try expanding directory completion if it makes sense Fixes #487 --- helix-term/src/ui/prompt.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helix-term/src/ui/prompt.rs b/helix-term/src/ui/prompt.rs index a4cb26f7c..2df1e281f 100644 --- a/helix-term/src/ui/prompt.rs +++ b/helix-term/src/ui/prompt.rs @@ -463,7 +463,7 @@ impl Component for Prompt { code: KeyCode::Enter, .. } => { - if self.line.ends_with('/') { + if self.selection.is_some() && self.line.ends_with('/') { self.completion = (self.completion_fn)(&self.line); self.exit_selection(); } else {