picker: open file on Enter.

pull/7/head
Blaž Hrastnik 4 years ago
parent edfd3933db
commit 8b263ef04b

@ -159,6 +159,16 @@ impl Component for Picker {
} => { } => {
return close_fn; 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) { match self.prompt.handle_event(event, cx) {
EventResult::Consumed(_) => { EventResult::Consumed(_) => {

Loading…
Cancel
Save