Merge pull request #1367 from Cheong-Lau/fix-next-tab
fix(tab): next tab not wrapping around to 0
This commit is contained in:
commit
bb7f0c5748
1 changed files with 3 additions and 2 deletions
|
|
@ -3765,12 +3765,13 @@ impl Application for App {
|
|||
}
|
||||
Message::TabNext => {
|
||||
let len = self.tab_model.len();
|
||||
let pos = self
|
||||
let pos = (self
|
||||
.tab_model
|
||||
.position(self.tab_model.active())
|
||||
.expect("should always be at least one tab open")
|
||||
+ 1)
|
||||
// Wraparound to 0 if i + 1 > num of tabs
|
||||
+ 1 % len as u16;
|
||||
% len as u16;
|
||||
|
||||
let entity = self.tab_model.entity_at(pos);
|
||||
if let Some(entity) = entity {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue