mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-08-30 19:11:39 +00:00
introduce split-preserve-zoom config to maintain zoomed splits during navigation
This commit is contained in:
committed by
Mitchell Hashimoto
parent
67eb480577
commit
d364e421a8
@@ -621,9 +621,14 @@ class BaseTerminalController: NSWindowController,
|
||||
return
|
||||
}
|
||||
|
||||
// Remove the zoomed state for this surface tree.
|
||||
if surfaceTree.zoomed != nil {
|
||||
surfaceTree = .init(root: surfaceTree.root, zoomed: nil)
|
||||
if derivedConfig.splitPreserveZoom.contains(.navigation) {
|
||||
surfaceTree = SplitTree(
|
||||
root: surfaceTree.root,
|
||||
zoomed: surfaceTree.root?.node(view: nextSurface))
|
||||
} else {
|
||||
surfaceTree = SplitTree(root: surfaceTree.root, zoomed: nil)
|
||||
}
|
||||
}
|
||||
|
||||
// Move focus to the next surface
|
||||
@@ -1188,17 +1193,20 @@ class BaseTerminalController: NSWindowController,
|
||||
let macosTitlebarProxyIcon: Ghostty.MacOSTitlebarProxyIcon
|
||||
let windowStepResize: Bool
|
||||
let focusFollowsMouse: Bool
|
||||
let splitPreserveZoom: Ghostty.Config.SplitPreserveZoom
|
||||
|
||||
init() {
|
||||
self.macosTitlebarProxyIcon = .visible
|
||||
self.windowStepResize = false
|
||||
self.focusFollowsMouse = false
|
||||
self.splitPreserveZoom = .init()
|
||||
}
|
||||
|
||||
init(_ config: Ghostty.Config) {
|
||||
self.macosTitlebarProxyIcon = config.macosTitlebarProxyIcon
|
||||
self.windowStepResize = config.windowStepResize
|
||||
self.focusFollowsMouse = config.focusFollowsMouse
|
||||
self.splitPreserveZoom = config.splitPreserveZoom
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user