Skip to content

Commit

Permalink
fix subdir bug
Browse files Browse the repository at this point in the history
  • Loading branch information
nnyyxxxx committed Nov 13, 2024
1 parent d339441 commit 78660f5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tui/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
Expand Down

0 comments on commit 78660f5

Please sign in to comment.