Skip to content

Commit

Permalink
fixes broken scrolling on pageup and pagedown
Browse files Browse the repository at this point in the history
  • Loading branch information
alfredolito committed Oct 14, 2024
1 parent e6597bb commit 086653d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions cursive/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ fn up(ui: &mut Cursive) {
}

fn page_down(ui: &mut Cursive) {
let mut l = ui
.find_name::<SelectView<pass::PasswordEntry>>("results")
.unwrap();
l.select_down(screen_height(ui));
let rows = screen_height(&ui);
ui.call_on_name("results", |l: &mut SelectView<pass::PasswordEntry>| {
l.select_down(rows);
});
ui.call_on_name(
"scroll_results",
|l: &mut ScrollView<ResizedView<NamedView<SelectView<pass::PasswordEntry>>>>| {
Expand All @@ -119,10 +119,10 @@ fn page_down(ui: &mut Cursive) {
}

fn page_up(ui: &mut Cursive) {
let mut l = ui
.find_name::<SelectView<pass::PasswordEntry>>("results")
.unwrap();
l.select_up(screen_height(ui));
let rows = screen_height(&ui);
ui.call_on_name("results", |l: &mut SelectView<pass::PasswordEntry>| {
l.select_up(rows);
});
ui.call_on_name(
"scroll_results",
|l: &mut ScrollView<ResizedView<NamedView<SelectView<pass::PasswordEntry>>>>| {
Expand Down

0 comments on commit 086653d

Please sign in to comment.