mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 00:06:09 +03:00
Merge pull request #1045 from mitchellh/macos-tab
macos: previous_tab/next_tab wraps
This commit is contained in:
@ -440,9 +440,17 @@ class TerminalController: NSWindowController, NSWindowDelegate,
|
||||
guard let selectedIndex = tabbedWindows.firstIndex(where: { $0 == selectedWindow }) else { return }
|
||||
|
||||
if (tabIndex == GHOSTTY_TAB_PREVIOUS.rawValue) {
|
||||
finalIndex = selectedIndex - 1
|
||||
if (selectedIndex == 0) {
|
||||
finalIndex = tabbedWindows.count - 1
|
||||
} else {
|
||||
finalIndex = selectedIndex - 1
|
||||
}
|
||||
} else if (tabIndex == GHOSTTY_TAB_NEXT.rawValue) {
|
||||
finalIndex = selectedIndex + 1
|
||||
if (selectedIndex == tabbedWindows.count - 1) {
|
||||
finalIndex = 0
|
||||
} else {
|
||||
finalIndex = selectedIndex + 1
|
||||
}
|
||||
} else {
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user