mirror of https://github.com/helix-editor/helix
[picker] feat: navigate backward and forward
* Add <A-p> and <A-n> keybinds to navigate in the global search picker history.pull/12536/head
parent
7ebf650029
commit
afa057fe51
|
@ -456,6 +456,8 @@ See the documentation page on [pickers](./pickers.md) for more info.
|
||||||
| `PageDown`, `Ctrl-d` | Page down |
|
| `PageDown`, `Ctrl-d` | Page down |
|
||||||
| `Home` | Go to first entry |
|
| `Home` | Go to first entry |
|
||||||
| `End` | Go to last entry |
|
| `End` | Go to last entry |
|
||||||
|
| `Alt-p` | Select previous history |
|
||||||
|
| `Alt-n` | Select next history |
|
||||||
| `Enter` | Open selected |
|
| `Enter` | Open selected |
|
||||||
| `Alt-Enter` | Open selected in the background without closing the picker |
|
| `Alt-Enter` | Open selected in the background without closing the picker |
|
||||||
| `Ctrl-s` | Open horizontally |
|
| `Ctrl-s` | Open horizontally |
|
||||||
|
|
|
@ -1106,6 +1106,26 @@ impl<I: 'static + Send + Sync, D: 'static + Send + Sync> Component for Picker<I,
|
||||||
return close_fn(self);
|
return close_fn(self);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
alt!('p') => {
|
||||||
|
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') => {
|
ctrl!('s') => {
|
||||||
if let Some(option) = self.selection() {
|
if let Some(option) = self.selection() {
|
||||||
(self.callback_fn)(ctx, option, Action::HorizontalSplit);
|
(self.callback_fn)(ctx, option, Action::HorizontalSplit);
|
||||||
|
|
Loading…
Reference in New Issue