on master help sign in
Trigger directory completion upon pressing Enter
145bc19Kevin Sjöberg
helix-term/src/ui/prompt.rs+7−2
@@ -253,8 +253,13 @@ impl Component for Prompt {
253 code: KeyCode::Enter,
253 code: KeyCode::Enter,
254 ..
254 ..
255 } => {
255 } => {
256+ if self.line.ends_with('/') {
257+ self.completion = (self.completion_fn)(&self.line);
258+ self.exit_selection();
259+ } else {
256− (self.callback_fn)(cx.editor, &self.line, PromptEvent::Validate);
260+ (self.callback_fn)(cx.editor, &self.line, PromptEvent::Validate);
257− return close_fn;
261+ return close_fn;
262+ }
258 }
263 }
259 KeyEvent {
264 KeyEvent {
260 code: KeyCode::Tab, ..
265 code: KeyCode::Tab, ..