Use 1-indexed values when dealing with tabs

This commit is contained in:
Justin Su
2024-07-21 03:31:33 -04:00
parent 823e073795
commit f57f9f2ec9

View File

@ -130,13 +130,13 @@ class TerminalController: NSWindowController, NSWindowDelegate,
// otherwise the accessory view doesn't matter. // otherwise the accessory view doesn't matter.
tabListenForFrame = windows.count > 1 tabListenForFrame = windows.count > 1
for (index, window) in windows.enumerated() { for (tab, window) in zip(1..., windows) {
guard index < 9 else { guard tab <= 9 else {
window.keyEquivalent = "" window.keyEquivalent = ""
continue continue
} }
let action = "goto_tab:\(index + 1)" let action = "goto_tab:\(tab)"
if let equiv = ghostty.config.keyEquivalent(for: action) { if let equiv = ghostty.config.keyEquivalent(for: action) {
window.keyEquivalent = "\(equiv)" window.keyEquivalent = "\(equiv)"