Add support for panning all the way left/right (#131)

This commit is contained in:
Ishan Deshpande
2026-01-27 22:50:01 -06:00
committed by GitHub
parent 577141e201
commit 580af3668f
+8
View File
@@ -136,6 +136,12 @@ impl Zoom {
fn pan_top(&mut self) { fn pan_top(&mut self) {
self.cell_pan_from_top = u16::MAX; self.cell_pan_from_top = u16::MAX;
} }
fn pan_left(&mut self) {
self.cell_pan_from_left = 0;
}
fn pan_right(&mut self) {
self.cell_pan_from_left = u16::MAX;
}
} }
#[derive(Clone, Copy, Debug)] #[derive(Clone, Copy, Debug)]
enum Direction { enum Direction {
@@ -828,6 +834,8 @@ impl Tui {
'J' if can_zoom => self.update_zoom(|z| z.pan(Direction::Down)), 'J' if can_zoom => self.update_zoom(|z| z.pan(Direction::Down)),
'K' if can_zoom => self.update_zoom(|z| z.pan(Direction::Up)), 'K' if can_zoom => self.update_zoom(|z| z.pan(Direction::Up)),
'G' if can_zoom => self.update_zoom(Zoom::pan_top), 'G' if can_zoom => self.update_zoom(Zoom::pan_top),
'0' if can_zoom => self.update_zoom(Zoom::pan_left),
'$' if can_zoom => self.update_zoom(Zoom::pan_right),
_ => None _ => None
} }
} }