Skip to content

Commit

Permalink
fix: Correct maximum scroll index within subdirectories
Browse files Browse the repository at this point in the history
  • Loading branch information
lj3954 committed Jan 22, 2025
1 parent 15c40d1 commit ae9328e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tui/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,10 @@ impl AppState {

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

if selected == max_index {
self.selection.select_first();
} else {
self.selection.select_next();
Expand Down

0 comments on commit ae9328e

Please sign in to comment.