Skip to content

Commit

Permalink
Fix scroll down not reaching bottom entry
Browse files Browse the repository at this point in the history
  • Loading branch information
jeevithakannan2 committed Nov 21, 2024
1 parent ab7a670 commit c8dd5c7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tui/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -596,8 +596,13 @@ impl AppState {
}

fn scroll_down(&mut self) {
let entries = if self.at_root() {
self.filter.item_list().len() - 1
} else {
self.filter.item_list().len()
};
if let Some(selected) = self.selection.selected() {
if selected == self.filter.item_list().len() - 1 {
if selected == entries {
self.selection.select_first();
} else {
self.selection.select_next();
Expand Down

0 comments on commit c8dd5c7

Please sign in to comment.