Skip to content

Commit

Permalink
Scroll the whole page on Left/Right arrows (#764)
Browse files Browse the repository at this point in the history
Seeking char by char can take awhile...
  • Loading branch information
azat authored May 24, 2024
1 parent f77a954 commit a281c9f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cursive-core/src/view/scroll/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,12 +313,14 @@ pub fn on_event<Model: ?Sized>(
Event::Ctrl(Key::Left) | Event::Key(Key::Left)
if get_scroller(model).can_scroll_left() =>
{
get_scroller(model).scroll_left(1);
let scroller = get_scroller(model);
scroller.scroll_left(scroller.last_available_size().x);
}
Event::Ctrl(Key::Right) | Event::Key(Key::Right)
if get_scroller(model).can_scroll_right() =>
{
get_scroller(model).scroll_right(1);
let scroller = get_scroller(model);
scroller.scroll_right(scroller.last_available_size().x);
}
_ => return EventResult::Ignored,
};
Expand Down

0 comments on commit a281c9f

Please sign in to comment.