mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-23 01:46:18 +04:00
Trigger directory completion upon pressing Enter
This commit is contained in:
parent
54f3548d54
commit
145bc1970a
@ -253,9 +253,14 @@ fn handle_event(&mut self, event: Event, cx: &mut Context) -> EventResult {
|
||||
code: KeyCode::Enter,
|
||||
..
|
||||
} => {
|
||||
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, ..
|
||||
} => self.change_completion_selection(),
|
||||
|
Loading…
Reference in New Issue
Block a user