macos: enter goes to next result

This commit is contained in:
Mitchell Hashimoto
2025-11-25 17:21:04 -08:00
parent 72708b8253
commit efc05523e0
2 changed files with 6 additions and 1 deletions

View File

@@ -412,6 +412,11 @@ extension Ghostty {
.background(Color.primary.opacity(0.1))
.cornerRadius(6)
.focused($isSearchFieldFocused)
.onSubmit {
guard let surface = surfaceView.surface else { return }
let action = "navigate_search:next"
ghostty_surface_binding_action(surface, action, UInt(action.count))
}
.onExitCommand {
Ghostty.moveFocus(to: surfaceView)
}

View File

@@ -69,7 +69,7 @@ extension Ghostty {
@Published var searchState: SearchState? = nil {
didSet {
if let searchState {
searchNeedleCancellable = searchState.$needle.sink { [weak self] needle in
searchNeedleCancellable = searchState.$needle.removeDuplicates().sink { [weak self] needle in
guard let surface = self?.surface else { return }
guard needle.count > 1 else { return }
let action = "search:\(needle)"