From f6b8358fcc5e74043c4bf1efe622793173e19917 Mon Sep 17 00:00:00 2001 From: nnyyxxxx Date: Tue, 12 Nov 2024 23:46:44 -0500 Subject: [PATCH] fix subdir bug --- tui/src/state.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tui/src/state.rs b/tui/src/state.rs index 4ecc2c95..7889e9a1 100644 --- a/tui/src/state.rs +++ b/tui/src/state.rs @@ -508,7 +508,12 @@ impl AppState { let list_start = areas.list.y + 4; let relative_y = position.y.saturating_sub(list_start); let list_len = self.filter.item_list().len(); - if relative_y < list_len as u16 { + let adjusted_len = if self.at_root() { + list_len + } else { + list_len + 1 + }; + if relative_y < adjusted_len as u16 { self.selection.select(Some(relative_y as usize)); } }