Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes broken scrolling on pageup and pagedown #363

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading