Skip to content

Commit 5d61631

Browse files
authored
Resolve conflicts between prompt/picker bindings (#1792)
Currently, the picker's re-using a few bindings which are also present in the prompt. This causes some editing behaviours to not function on the picker. **Ctrl + k** and **Ctrl + j** This should kill till the end of the line on prompt, but is overridden by the picker for scrolling. Since there are redundancies (`Ctrl + p`, `Ctrl + n`), we can remove it from picker. **Ctrl + f** and **Ctrl + b** This are used by the prompt for back/forward movement. We could modify it to be Ctrl + d and Ctrl + u, to match the `vim` behaviour.
1 parent ef91b65 commit 5d61631

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

book/src/keymap.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -331,10 +331,10 @@ Keys to use within picker. Remapping currently not supported.
331331

332332
| Key | Description |
333333
| ----- | ------------- |
334-
| `Up`, `Ctrl-k`, `Ctrl-p` | Previous entry |
335-
| `PageUp`, `Ctrl-b` | Page up |
336-
| `Down`, `Ctrl-j`, `Ctrl-n` | Next entry |
337-
| `PageDown`, `Ctrl-f` | Page down |
334+
| `Up`, `Ctrl-p` | Previous entry |
335+
| `PageUp`, `Ctrl-u` | Page up |
336+
| `Down`, `Ctrl-n` | Next entry |
337+
| `PageDown`, `Ctrl-d` | Page down |
338338
| `Home` | Go to first entry |
339339
| `End` | Go to last entry |
340340
| `Ctrl-space` | Filter options |

helix-term/src/ui/picker.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -498,16 +498,16 @@ impl<T: 'static> Component for Picker<T> {
498498
})));
499499

500500
match key_event.into() {
501-
shift!(Tab) | key!(Up) | ctrl!('p') | ctrl!('k') => {
501+
shift!(Tab) | key!(Up) | ctrl!('p') => {
502502
self.move_by(1, Direction::Backward);
503503
}
504-
key!(Tab) | key!(Down) | ctrl!('n') | ctrl!('j') => {
504+
key!(Tab) | key!(Down) | ctrl!('n') => {
505505
self.move_by(1, Direction::Forward);
506506
}
507-
key!(PageDown) | ctrl!('f') => {
507+
key!(PageDown) | ctrl!('d') => {
508508
self.page_down();
509509
}
510-
key!(PageUp) | ctrl!('b') => {
510+
key!(PageUp) | ctrl!('u') => {
511511
self.page_up();
512512
}
513513
key!(Home) => {

0 commit comments

Comments
 (0)