on master help sign in
Preselect first item in code action popup menu
547c3ecGokul Soumya
helix-term/src/commands.rs+3−1
@@ -3503,7 +3503,7 @@ pub fn code_action(cx: &mut Context) {
3503 return;
3503 return;
3504 }
3504 }
3505
3505
3506− let picker = ui::Menu::new(actions, move |editor, code_action, event| {
3506+ let mut picker = ui::Menu::new(actions, move |editor, code_action, event| {
3507 if event != PromptEvent::Validate {
3507 if event != PromptEvent::Validate {
3508 return;
3508 return;
3509 }
3509 }
@@ -3531,6 +3531,8 @@ pub fn code_action(cx: &mut Context) {
3531 }
3531 }
3532 }
3532 }
3533 });
3533 });
3534+ picker.move_down(); // pre-select the first item
3535+
3534 let popup = Popup::new("code-action", picker).margin(helix_view::graphics::Margin {
3536 let popup = Popup::new("code-action", picker).margin(helix_view::graphics::Margin {
3535 vertical: 1,
3537 vertical: 1,
3536 horizontal: 1,
3538 horizontal: 1,