mirror of
https://github.com/kdheepak/taskwarrior-tui.git
synced 2025-08-25 08:47:18 +02:00
Merge pull request #180 from meain/scroll-fix
Fix next_page selection calculation
This commit is contained in:
commit
55dbcd41ca
1 changed files with 8 additions and 5 deletions
13
src/app.rs
13
src/app.rs
|
@ -1187,16 +1187,19 @@ impl TaskwarriorTuiApp {
|
|||
return;
|
||||
}
|
||||
let i = {
|
||||
if self.current_selection >= self.tasks.len() - 1 {
|
||||
if self.current_selection == self.tasks.len() - 1 {
|
||||
if self.config.uda_task_report_looping {
|
||||
0
|
||||
} else {
|
||||
self.current_selection
|
||||
self.tasks.len() - 1
|
||||
}
|
||||
} else {
|
||||
self.current_selection
|
||||
.checked_add(self.task_report_height as usize)
|
||||
.unwrap_or_else(|| self.tasks.len())
|
||||
std::cmp::min(
|
||||
self.current_selection
|
||||
.checked_add(self.task_report_height as usize)
|
||||
.unwrap_or_else(|| self.tasks.len() - 1),
|
||||
self.tasks.len() - 1,
|
||||
)
|
||||
}
|
||||
};
|
||||
self.current_selection = i;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue