Handle ^F, ^B, ^U and ^D readline shortcuts in pager (#42)

This commit is contained in:
Ryan Burns 2024-02-28 18:33:15 -08:00 committed by GitHub
parent fb24063c54
commit 28348606bf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 16 additions and 0 deletions

View File

@ -178,6 +178,22 @@ pub fn run(args: Args) -> Result<()> {
skip += per_page;
redraw = true;
}
KeyCode::Char('f') if event.modifiers.contains(KeyModifiers::CONTROL) => {
skip += per_page;
redraw = true;
}
KeyCode::Char('b') if event.modifiers.contains(KeyModifiers::CONTROL) => {
skip = skip.saturating_sub(per_page);
redraw = true;
}
KeyCode::Char('d') if event.modifiers.contains(KeyModifiers::CONTROL) => {
skip += per_page / 2;
redraw = true;
}
KeyCode::Char('u') if event.modifiers.contains(KeyModifiers::CONTROL) => {
skip = skip.saturating_sub(per_page / 2);
redraw = true;
}
// Scroll down
KeyCode::Down | KeyCode::Char('j') => {
skip += 1;