aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/ui/picker.rs
diff options
context:
space:
mode:
authorBlaž Hrastnik2020-12-18 08:16:04 +0000
committerBlaž Hrastnik2020-12-18 08:16:04 +0000
commit8b263ef04b8a1399727c41b4e2f4017fc0be9316 (patch)
tree8127e7b1661aefd2d7b4b7747ed3b4adfe663896 /helix-term/src/ui/picker.rs
parentedfd3933dbdfe30e05533beff625e0ddd446f41f (diff)
picker: open file on Enter.
Diffstat (limited to 'helix-term/src/ui/picker.rs')
-rw-r--r--helix-term/src/ui/picker.rs10
1 files changed, 10 insertions, 0 deletions
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(_) => {