Fix scroll down not reaching bottom entry

This commit is contained in:
Jeevitha Kannan K S 2024-11-21 10:19:44 +05:30
parent ab7a67087d
commit c8dd5c779c
No known key found for this signature in database
GPG Key ID: 5904C34A2F7CE333

View File

@ -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();