Fix(strider): Ignore descending into empty dir
Adds a guard to check if the directory is empty before trying to descend into it. Eg: Doesn't error anymore, if inside ./git/branches directory and pressing `l`.
This commit is contained in:
parent
d818661c72
commit
9ba26e7367
1 changed files with 1 additions and 1 deletions
|
|
@ -23,7 +23,7 @@ impl ZellijTile for State {
|
|||
let next = self.selected().saturating_add(1);
|
||||
*self.selected_mut() = min(self.files.len() - 1, next);
|
||||
}
|
||||
Key::Right | Key::Char('\n') | Key::Char('l') => {
|
||||
Key::Right | Key::Char('\n') | Key::Char('l') if !self.files.is_empty() => {
|
||||
match self.files[self.selected()].clone() {
|
||||
FsEntry::Dir(p, _) => {
|
||||
self.path = p;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue