on master help sign in
Preselect first item in code action popup menu
commit547c3ecd0c72f2b88fa2b3c1321ad9adcb42ee47 authorGokul Soumya <gokulps15@gmail.com> dateMon 7 Feb 2022, 21:34 (5 years ago) parente90276d
1 file changed+3−1
helix-term/src/commands.rs+3−1
helix-term/src/commands.rs+3−1
@@ -3503,7 +3503,7 @@ pub fn code_action(cx: &mut Context) {
35033503 return;
35043504 }
35053505
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| {
35073507 if event != PromptEvent::Validate {
35083508 return;
35093509 }
@@ -3531,6 +3531,8 @@ pub fn code_action(cx: &mut Context) {
35313531 }
35323532 }
35333533 });
3534+ picker.move_down(); // pre-select the first item
3535+
35343536 let popup = Popup::new("code-action", picker).margin(helix_view::graphics::Margin {
35353537 vertical: 1,
35363538 horizontal: 1,