Skip to content

Commit

Permalink
apply changes proposed by adam round 2
Browse files Browse the repository at this point in the history
Co-authored-by: Adam Perkowski <[email protected]>
  • Loading branch information
nnyyxxxx and adamperkowski authored Oct 2, 2024
1 parent 063d512 commit c12097d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tui/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,7 @@ impl AppState {
} else {
current + 1
};

self.selection.select(Some(next));
}

Expand All @@ -527,6 +528,7 @@ impl AppState {
let current = self.selection.selected().unwrap_or(0);
let max_index = if self.at_root() { len - 1 } else { len };
let next = if current == 0 { max_index } else { current - 1 };

self.selection.select(Some(next));
}

Expand Down Expand Up @@ -757,6 +759,7 @@ impl AppState {
let len = self.tabs.len();
let current = self.current_tab.selected().unwrap_or(0);
let next = if current + 1 >= len { 0 } else { current + 1 };

self.current_tab.select(Some(next));
self.refresh_tab();
}
Expand All @@ -765,6 +768,7 @@ impl AppState {
let len = self.tabs.len();
let current = self.current_tab.selected().unwrap_or(0);
let next = if current == 0 { len - 1 } else { current - 1 };

self.current_tab.select(Some(next));
self.refresh_tab();
}
Expand Down

0 comments on commit c12097d

Please sign in to comment.