Merge pull request #3651 from sharkdp/minus_home_end_keys
Add Home/End key bindings to builtin minus pager
This commit is contained in:
2 files changed
+15
-3
No files matched your search
+3
-3
@@ -1,7 +1,5 @@
|
|||||||
# unreleased
|
# unreleased
|
||||||
|
|
||||||
- Fixed bug caused by using `--plain` and `--terminal-width=N` flags simultaneously, see #3529 (@H4k1l)
|
|
||||||
- Fixed syntax tests path, see #3610 (@foxfromworld)
|
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
@@ -27,11 +25,13 @@
|
|||||||
- `--help` now correctly honors `--pager=builtin`. See #3516 (@keith-hall)
|
- `--help` now correctly honors `--pager=builtin`. See #3516 (@keith-hall)
|
||||||
- `--help` now correctly honors custom themes. See #3524 (@keith-hall)
|
- `--help` now correctly honors custom themes. See #3524 (@keith-hall)
|
||||||
- Fixed test compatibility with future Cargo build directory changes, see #3550 (@nmacl)
|
- Fixed test compatibility with future Cargo build directory changes, see #3550 (@nmacl)
|
||||||
|
- Fixed bug caused by using `--plain` and `--terminal-width=N` flags simultaneously, see #3529 (@H4k1l)
|
||||||
|
- Fixed syntax tests path, see #3610 (@foxfromworld)
|
||||||
|
|
||||||
## Other
|
## Other
|
||||||
- Use git version of cross. See #3533 (@OctopusET)
|
- Use git version of cross. See #3533 (@OctopusET)
|
||||||
|
|
||||||
- Bump MSRV to 1.88, update `time` crate to 0.3.47 to fix RUSTSEC-2026-0009, see #3581 (@NORMAL-EX)
|
- Bump MSRV to 1.88, update `time` crate to 0.3.47 to fix RUSTSEC-2026-0009, see #3581 (@NORMAL-EX)
|
||||||
|
- Allow home and end keys to be used with builtin pager, see #3651 (@keith-hall)
|
||||||
|
|
||||||
## Syntaxes
|
## Syntaxes
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,18 @@ pub struct BuiltinPager {
|
|||||||
impl BuiltinPager {
|
impl BuiltinPager {
|
||||||
fn new() -> Self {
|
fn new() -> Self {
|
||||||
let pager = minus::Pager::new();
|
let pager = minus::Pager::new();
|
||||||
|
|
||||||
|
let mut input_register = minus::input::HashedEventRegister::default();
|
||||||
|
input_register.add_key_events(&["home"], |_, _| {
|
||||||
|
minus::input::InputEvent::UpdateUpperMark(0)
|
||||||
|
});
|
||||||
|
input_register.add_key_events(&["end"], |_, _| {
|
||||||
|
minus::input::InputEvent::UpdateUpperMark(usize::MAX)
|
||||||
|
});
|
||||||
|
pager
|
||||||
|
.set_input_classifier(Box::new(input_register))
|
||||||
|
.expect("failed to set input classifier on newly created pager");
|
||||||
|
|
||||||
let handle = {
|
let handle = {
|
||||||
let pager = pager.clone();
|
let pager = pager.clone();
|
||||||
Some(spawn(move || {
|
Some(spawn(move || {
|
||||||
|
|||||||
Reference in new issue
Block a user