mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-09-24 03:58:35 +00:00
apprt/embedded: close surface callback
This commit is contained in:
@@ -143,15 +143,23 @@ extension Ghostty {
|
||||
.onReceive(pub) { onNewSplit(notification: $0) }
|
||||
case .horizontal:
|
||||
SplitView(.horizontal, left: {
|
||||
let pub = NotificationCenter.default.publisher(for: Ghostty.Notification.ghosttyCloseSurface, object: state.topLeft)
|
||||
TerminalSplitChild(app, topLeft: state.topLeft)
|
||||
.onReceive(pub) { _ in closeTopLeft() }
|
||||
}, right: {
|
||||
let pub = NotificationCenter.default.publisher(for: Ghostty.Notification.ghosttyCloseSurface, object: state.bottomRight!)
|
||||
TerminalSplitChild(app, topLeft: state.bottomRight!)
|
||||
.onReceive(pub) { _ in closeBottomRight() }
|
||||
})
|
||||
case .vertical:
|
||||
SplitView(.vertical, left: {
|
||||
let pub = NotificationCenter.default.publisher(for: Ghostty.Notification.ghosttyCloseSurface, object: state.topLeft)
|
||||
TerminalSplitChild(app, topLeft: state.topLeft)
|
||||
.onReceive(pub) { _ in closeTopLeft() }
|
||||
}, right: {
|
||||
let pub = NotificationCenter.default.publisher(for: Ghostty.Notification.ghosttyCloseSurface, object: state.bottomRight!)
|
||||
TerminalSplitChild(app, topLeft: state.bottomRight!)
|
||||
.onReceive(pub) { _ in closeBottomRight() }
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user