diff --git a/tui/src/state.rs b/tui/src/state.rs index cec9cc3c..6ecb7027 100644 --- a/tui/src/state.rs +++ b/tui/src/state.rs @@ -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();