more: support PageDown/PageUp keys

This commit is contained in:
Daniel Hofstetter 2023-05-18 15:24:49 +02:00
parent 74e73bee06
commit 932f44d3dc

View file

@ -257,6 +257,11 @@ fn more(buff: &str, stdout: &mut Stdout, next_file: Option<&str>, silent: bool)
modifiers: KeyModifiers::NONE,
..
})
| Event::Key(KeyEvent {
code: KeyCode::PageDown,
modifiers: KeyModifiers::NONE,
..
})
| Event::Key(KeyEvent {
code: KeyCode::Char(' '),
modifiers: KeyModifiers::NONE,
@ -272,6 +277,11 @@ fn more(buff: &str, stdout: &mut Stdout, next_file: Option<&str>, silent: bool)
code: KeyCode::Up,
modifiers: KeyModifiers::NONE,
..
})
| Event::Key(KeyEvent {
code: KeyCode::PageUp,
modifiers: KeyModifiers::NONE,
..
}) => {
pager.page_up();
}