Skip to content

Commit

Permalink
Merge pull request #363 from alfredolito/fix/pageup-n-pagedown-scrolling
Browse files Browse the repository at this point in the history
fixes broken scrolling on pageup and pagedown
  • Loading branch information
alexanderkjall authored Oct 22, 2024
2 parents e6597bb + 91f8c62 commit b587b04
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) - 7;
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) - 7;
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 b587b04

Please sign in to comment.