Merge pull request #1367 from Cheong-Lau/fix-next-tab

fix(tab): next tab not wrapping around to 0
This commit is contained in:
Jeremy Soller 2025-11-11 20:04:46 -07:00 committed by GitHub
commit bb7f0c5748
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 {