diff --git a/macos/Sources/Ghostty/SurfaceView.swift b/macos/Sources/Ghostty/SurfaceView.swift index 6d17258d8..5a746a2c7 100644 --- a/macos/Sources/Ghostty/SurfaceView.swift +++ b/macos/Sources/Ghostty/SurfaceView.swift @@ -409,11 +409,27 @@ extension Ghostty { TextField("Search", text: $searchState.needle) .textFieldStyle(.plain) .frame(width: 180) - .padding(.horizontal, 8) + .padding(.leading, 8) + .padding(.trailing, 50) .padding(.vertical, 6) .background(Color.primary.opacity(0.1)) .cornerRadius(6) .focused($isSearchFieldFocused) + .overlay(alignment: .trailing) { + if let selected = searchState.selected { + Text("\(selected + 1)/\(searchState.total, default: "?")") + .font(.caption) + .foregroundColor(.secondary) + .monospacedDigit() + .padding(.trailing, 8) + } else if let total = searchState.total { + Text("-/\(total)") + .font(.caption) + .foregroundColor(.secondary) + .monospacedDigit() + .padding(.trailing, 8) + } + } #if canImport(AppKit) .onExitCommand { Ghostty.moveFocus(to: surfaceView) @@ -427,19 +443,7 @@ extension Ghostty { ghostty_surface_binding_action(surface, action, UInt(action.count)) return .handled } - - if let selected = searchState.selected { - Text("\(selected + 1)/\(searchState.total, default: "?")") - .font(.caption) - .foregroundColor(.secondary) - .monospacedDigit() - } else if let total = searchState.total { - Text("-/\(total)") - .font(.caption) - .foregroundColor(.secondary) - .monospacedDigit() - } - + Button(action: { guard let surface = surfaceView.surface else { return } let action = "navigate_search:next"