diff --git a/tui/src/state.rs b/tui/src/state.rs index cec9cc3c..73028fbb 100644 --- a/tui/src/state.rs +++ b/tui/src/state.rs @@ -596,8 +596,13 @@ impl AppState { } fn scroll_down(&mut self) { + let num_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 == num_entries { self.selection.select_first(); } else { self.selection.select_next();