aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/ui
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term/src/ui')
-rw-r--r--helix-term/src/ui/prompt.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/helix-term/src/ui/prompt.rs b/helix-term/src/ui/prompt.rs
index cdf303b8..0a88aa90 100644
--- a/helix-term/src/ui/prompt.rs
+++ b/helix-term/src/ui/prompt.rs
@@ -253,8 +253,13 @@ impl Component for Prompt {
code: KeyCode::Enter,
..
} => {
- (self.callback_fn)(cx.editor, &self.line, PromptEvent::Validate);
- return close_fn;
+ if self.line.ends_with('/') {
+ self.completion = (self.completion_fn)(&self.line);
+ self.exit_selection();
+ } else {
+ (self.callback_fn)(cx.editor, &self.line, PromptEvent::Validate);
+ return close_fn;
+ }
}
KeyEvent {
code: KeyCode::Tab, ..