macos: unsplit window shouldn't allow split zooming

This was always the case, and is a recent regression from the SplitTree
rework. This brings it back to the previous behavior.
pull/7565/head
Mitchell Hashimoto 2025-06-10 12:11:17 -07:00
parent 57cd5ef085
commit 2b9a6a4820
No known key found for this signature in database
GPG Key ID: 523D5DC389D273BC
1 changed files with 4 additions and 1 deletions

View File

@ -556,12 +556,15 @@ class BaseTerminalController: NSWindowController,
// The target must be within our tree
guard let target = notification.object as? Ghostty.SurfaceView else { return }
guard let targetNode = surfaceTree.root?.node(view: target) else { return }
// Toggle the zoomed state
if surfaceTree.zoomed == targetNode {
// Already zoomed, unzoom it
surfaceTree = SplitTree(root: surfaceTree.root, zoomed: nil)
} else {
// We require that the split tree have splits
guard surfaceTree.isSplit else { return }
// Not zoomed or different node zoomed, zoom this node
surfaceTree = SplitTree(root: surfaceTree.root, zoomed: targetNode)
}