macos: unzoom on new split and focus change
parent
19a9156ae1
commit
5299f10e13
|
|
@ -108,11 +108,12 @@ extension SplitTree {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Insert a new view at the given view point by creating a split in the given direction.
|
/// 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 {
|
func insert(view: ViewType, at: ViewType, direction: NewDirection) throws -> Self {
|
||||||
guard let root else { throw SplitError.viewNotFound }
|
guard let root else { throw SplitError.viewNotFound }
|
||||||
return .init(
|
return .init(
|
||||||
root: try root.insert(view: view, at: at, direction: direction),
|
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,
|
/// Remove a node from the tree. If the node being removed is part of a split,
|
||||||
|
|
|
||||||
|
|
@ -451,6 +451,11 @@ class BaseTerminalController: NSWindowController,
|
||||||
return
|
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
|
// Move focus to the next surface
|
||||||
Ghostty.moveFocus(to: nextSurface, from: target)
|
Ghostty.moveFocus(to: nextSurface, from: target)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue