macos: changes to SearchState trigger calls to internals

pull/9709/head
Mitchell Hashimoto 2025-11-25 12:26:52 -08:00
parent 56d4a7f58e
commit 081d73d850
No known key found for this signature in database
GPG Key ID: 523D5DC389D273BC
1 changed files with 11 additions and 1 deletions

View File

@ -65,7 +65,17 @@ extension Ghostty {
@Published var keySequence: [KeyboardShortcut] = []
// The current search state. When non-nil, the search overlay should be shown.
@Published var searchState: SearchState? = nil
@Published var searchState: SearchState? = nil {
didSet {
// If the search state becomes nil, we need to make sure we're stopping
// the search internally.
if searchState == nil {
guard let surface = self.surface else { return }
let action = "search:"
ghostty_surface_binding_action(surface, action, UInt(action.count))
}
}
}
// The time this surface last became focused. This is a ContinuousClock.Instant
// on supported platforms.