on master help sign in
Added opening files in the background with A-ret shortcut (#4435)
d3e0f18Itay123
helix-term/src/ui/picker.rs+6
@@ -1,4 +1,5 @@
1use crate::{
1use crate::{
2+ alt,
2 compositor::{Component, Compositor, Context, Event, EventResult},
3 compositor::{Component, Compositor, Context, Event, EventResult},
3 ctrl, key, shift,
4 ctrl, key, shift,
4 ui::{self, fuzzy_match::FuzzyQuery, EditorView},
5 ui::{self, fuzzy_match::FuzzyQuery, EditorView},
@@ -619,6 +620,11 @@ impl<T: Item + 'static> Component for Picker<T> {
619 key!(Esc) | ctrl!('c') => {
620 key!(Esc) | ctrl!('c') => {
620 return close_fn;
621 return close_fn;
621 }
622 }
623+ alt!(Enter) => {
624+ if let Some(option) = self.selection() {
625+ (self.callback_fn)(cx, option, Action::Load);
626+ }
627+ }
622 key!(Enter) => {
628 key!(Enter) => {
623 if let Some(option) = self.selection() {
629 if let Some(option) = self.selection() {
624 (self.callback_fn)(cx, option, Action::Replace);
630 (self.callback_fn)(cx, option, Action::Replace);