fix(tab): next tab not wrapping around to 0

fixes: bd1fa1f0a9
This commit is contained in:
Cheong Lau 2025-11-12 12:24:33 +10:00
parent fa0be29199
commit 81a4fa206e

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 {