mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
macos: fix goto last tab
This commit is contained in:
@ -514,14 +514,14 @@ class TerminalController: BaseTerminalController {
|
||||
return
|
||||
}
|
||||
} else {
|
||||
// Tabs are 0-indexed here, so we subtract one from the key the user hit.
|
||||
finalIndex = Int(tabIndex - 1)
|
||||
// The configured value is 1-indexed.
|
||||
guard tabIndex >= 1 else { return }
|
||||
|
||||
// If our index is outside our boundary then we use the max
|
||||
finalIndex = min(Int(tabIndex - 1), tabbedWindows.count - 1)
|
||||
}
|
||||
|
||||
guard finalIndex >= 0 else { return }
|
||||
if finalIndex >= tabbedWindows.count {
|
||||
finalIndex = tabbedWindows.count - 1
|
||||
}
|
||||
let targetWindow = tabbedWindows[finalIndex]
|
||||
targetWindow.makeKeyAndOrderFront(nil)
|
||||
}
|
||||
|
@ -297,7 +297,8 @@ pub const Action = union(enum) {
|
||||
/// Go to the last tab (the one with the highest index)
|
||||
last_tab: void,
|
||||
|
||||
/// Go to the tab with the specific number, 1-indexed.
|
||||
/// Go to the tab with the specific number, 1-indexed. If the tab number
|
||||
/// is higher than the number of tabs, this will go to the last tab.
|
||||
goto_tab: usize,
|
||||
|
||||
/// Toggle the tab overview.
|
||||
|
Reference in New Issue
Block a user