Add Home/End key bindings to builtin minus pager

Co-authored-by: keith-hall <11882719+keith-hall@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]andkeith-hall authored and Keith Hall committed 2026-03-24 21:33:43 +02:00
1 parent 0b4c886efc
commit 87e043b91c
1 file changed
+12
+12
View File
@@ -23,6 +23,18 @@ pub struct BuiltinPager {
impl BuiltinPager {
fn new() -> Self {
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 pager = pager.clone();
Some(spawn(move || {