fix subdir bug

This commit is contained in:
nnyyxxxx 2024-11-12 23:46:44 -05:00
parent 961511fb72
commit fbfcd5002c
No known key found for this signature in database
GPG Key ID: 6038FFD6589902CB

View File

@ -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));
}
}