diff --git a/book/src/keymap.md b/book/src/keymap.md index 2797eaee2..8a0bbe66f 100644 --- a/book/src/keymap.md +++ b/book/src/keymap.md @@ -456,6 +456,8 @@ See the documentation page on [pickers](./pickers.md) for more info. | `PageDown`, `Ctrl-d` | Page down | | `Home` | Go to first entry | | `End` | Go to last entry | +| `Alt-p` | Select previous history | +| `Alt-n` | Select next history | | `Enter` | Open selected | | `Alt-Enter` | Open selected in the background without closing the picker | | `Ctrl-s` | Open horizontally | diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs index a6ce91a67..48057185c 100644 --- a/helix-term/src/ui/picker.rs +++ b/helix-term/src/ui/picker.rs @@ -1106,6 +1106,26 @@ impl Component for Picker { + if let Some(register) = self.prompt.history_register() { + self.prompt.change_history( + ctx, + register, + ui::prompt::CompletionDirection::Backward, + ); + self.handle_prompt_change(true); + } + } + alt!('n') => { + if let Some(register) = self.prompt.history_register() { + self.prompt.change_history( + ctx, + register, + ui::prompt::CompletionDirection::Forward, + ); + self.handle_prompt_change(true); + } + } ctrl!('s') => { if let Some(option) = self.selection() { (self.callback_fn)(ctx, option, Action::HorizontalSplit);