diff options
| author | Ellie Huxtable <ellie@elliehuxtable.com> | 2023-02-24 15:49:05 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-24 15:49:05 +0000 |
| commit | 5f2db5b93e5a311cbd361e9c396b094ed094dc32 (patch) | |
| tree | 9ae8386893077e1d4240e05f51a8dd45acfc96a1 /src/command/client/search/interactive.rs | |
| parent | Remove shortcut numbers (#708) (diff) | |
| download | atuin-5f2db5b93e5a311cbd361e9c396b094ed094dc32.zip | |
Revert "Remove shortcut numbers (#708)" (#724)
This reverts commit 3fdd4f4591bc573906480c1c700df91ba866a2cb.
Diffstat (limited to '')
| -rw-r--r-- | src/command/client/search/interactive.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/command/client/search/interactive.rs b/src/command/client/search/interactive.rs index fb60b47b..903c3362 100644 --- a/src/command/client/search/interactive.rs +++ b/src/command/client/search/interactive.rs @@ -95,6 +95,7 @@ impl State { len: usize, ) -> Option<usize> { let ctrl = input.modifiers.contains(KeyModifiers::CONTROL); + let alt = input.modifiers.contains(KeyModifiers::ALT); match input.code { KeyCode::Char('c' | 'd' | 'g') if ctrl => return Some(RETURN_ORIGINAL), KeyCode::Esc => { @@ -106,6 +107,10 @@ impl State { KeyCode::Enter => { return Some(self.results_state.selected()); } + KeyCode::Char(c @ '1'..='9') if alt => { + let c = c.to_digit(10)? as usize; + return Some(self.results_state.selected() + c); + } KeyCode::Left => { self.input.left(); } |
