Skip to content

Commit

Permalink
Preselect first item in code action popup menu
Browse files Browse the repository at this point in the history
  • Loading branch information
sudormrfbin authored and archseer committed Feb 8, 2022
1 parent e90276d commit 547c3ec
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion helix-term/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3503,7 +3503,7 @@ pub fn code_action(cx: &mut Context) {
return;
}

let picker = ui::Menu::new(actions, move |editor, code_action, event| {
let mut picker = ui::Menu::new(actions, move |editor, code_action, event| {
if event != PromptEvent::Validate {
return;
}
Expand Down Expand Up @@ -3531,6 +3531,8 @@ pub fn code_action(cx: &mut Context) {
}
}
});
picker.move_down(); // pre-select the first item

let popup = Popup::new("code-action", picker).margin(helix_view::graphics::Margin {
vertical: 1,
horizontal: 1,
Expand Down

0 comments on commit 547c3ec

Please sign in to comment.