fix(window): ensure last_tab action on linux navigates to last tab (#5004)

Previously, the logic navigated to the second-to-last tab instead of the
last tab due to an off-by-one error. This updates the implementation so
that the index calculation to accurately target the last tab. In the
`gotoLastTab` method there was a decrement in the number of max number
of tabs and another increment in the `goToTab` method to get the actual
tab index.
pull/5028/head
Mitchell Hashimoto 2025-01-13 13:12:49 -08:00 committed by GitHub
commit e3ced14393
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -498,9 +498,9 @@ pub fn moveTab(self: *Window, surface: *Surface, position: c_int) void {
self.notebook.moveTab(tab, position);
}
/// Go to the next tab for a surface.
/// Go to the last tab for a surface.
pub fn gotoLastTab(self: *Window) void {
const max = self.notebook.nPages() -| 1;
const max = self.notebook.nPages();
self.gotoTab(@intCast(max));
}