macos: unzoom on new split and focus change

This commit is contained in:
Mitchell Hashimoto
2025-06-04 12:17:50 -07:00
parent 19a9156ae1
commit 5299f10e13
2 changed files with 7 additions and 1 deletions

View File

@@ -108,11 +108,12 @@ extension SplitTree {
}
/// Insert a new view at the given view point by creating a split in the given direction.
/// This will always reset the zoomed state of the tree.
func insert(view: ViewType, at: ViewType, direction: NewDirection) throws -> Self {
guard let root else { throw SplitError.viewNotFound }
return .init(
root: try root.insert(view: view, at: at, direction: direction),
zoomed: zoomed)
zoomed: nil)
}
/// Remove a node from the tree. If the node being removed is part of a split,

View File

@@ -451,6 +451,11 @@ class BaseTerminalController: NSWindowController,
return
}
// Remove the zoomed state for this surface tree.
if surfaceTree.zoomed != nil {
surfaceTree = .init(root: surfaceTree.root, zoomed: nil)
}
// Move focus to the next surface
Ghostty.moveFocus(to: nextSurface, from: target)
}