From 8b263ef04b8a1399727c41b4e2f4017fc0be9316 Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Fri, 18 Dec 2020 17:16:04 +0900 Subject: picker: open file on Enter. --- helix-term/src/ui/picker.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs index 82dbdd2e..3a3c648f 100644 --- a/helix-term/src/ui/picker.rs +++ b/helix-term/src/ui/picker.rs @@ -159,6 +159,16 @@ impl Component for Picker { } => { 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(_) => { -- cgit v1.2.3-70-g09d2