mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-05-26 06:48:33 +00:00
macOS: fix search bar Enter key blocking IME composition
Use onSubmit for the plain Enter → next-match behavior, which respects IME composition state. Keep onKeyPress only for Shift+Enter (previous match), returning .ignored for plain Enter so the IME can process it.
This commit is contained in:
@@ -417,6 +417,10 @@ extension Ghostty {
|
||||
// to our synced needle.
|
||||
searchState.readPasteboardNeedle()
|
||||
}
|
||||
.onSubmit {
|
||||
_ = surfaceView.navigateSearchToNext()
|
||||
}
|
||||
}
|
||||
#if canImport(AppKit)
|
||||
.onExitCommand {
|
||||
if searchState.needle.isEmpty {
|
||||
@@ -429,10 +433,9 @@ extension Ghostty {
|
||||
.backport.onKeyPress(.return) { modifiers in
|
||||
if modifiers.contains(.shift) {
|
||||
_ = surfaceView.navigateSearchToPrevious()
|
||||
} else {
|
||||
_ = surfaceView.navigateSearchToNext()
|
||||
return .handled
|
||||
}
|
||||
return .handled
|
||||
return .ignored
|
||||
}
|
||||
|
||||
Button(action: {
|
||||
|
||||
Reference in New Issue
Block a user