Trigger directory completion upon pressing Enter

imgbot
Kevin Sjöberg 4 years ago committed by Blaž Hrastnik
parent 54f3548d54
commit 145bc1970a

@ -253,8 +253,13 @@ impl Component for Prompt {
code: KeyCode::Enter, code: KeyCode::Enter,
.. ..
} => { } => {
(self.callback_fn)(cx.editor, &self.line, PromptEvent::Validate); if self.line.ends_with('/') {
return close_fn; self.completion = (self.completion_fn)(&self.line);
self.exit_selection();
} else {
(self.callback_fn)(cx.editor, &self.line, PromptEvent::Validate);
return close_fn;
}
} }
KeyEvent { KeyEvent {
code: KeyCode::Tab, .. code: KeyCode::Tab, ..

Loading…
Cancel
Save