1
0
Fork 0
mirror of https://github.com/helix-editor/helix synced 2024-06-07 09:46:06 +02:00

picker: open file on Enter.

This commit is contained in:
Blaž Hrastnik 2020-12-18 17:16:04 +09:00
parent edfd3933db
commit 8b263ef04b

View File

@ -159,6 +159,16 @@ fn handle_event(&mut self, event: Event, cx: &mut Context) -> EventResult {
} => {
return close_fn;
}
KeyEvent {
code: KeyCode::Enter,
..
} => {
let size = cx.editor.view().unwrap().size;
if let Some(path) = self.selection() {
cx.editor.open(path.into(), size);
}
return close_fn;
}
_ => {
match self.prompt.handle_event(event, cx) {
EventResult::Consumed(_) => {