macos: key input that clears preedit without text shouldn't encode (#7226)

Fixes #7225
pull/7228/head
Mitchell Hashimoto 2025-04-28 14:58:19 -07:00 committed by GitHub
commit 9a4419ce85
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 1 deletions

View File

@ -975,7 +975,14 @@ extension Ghostty {
event: event,
translationEvent: translationEvent,
text: translationEvent.ghosttyCharacters,
composing: markedText.length > 0
// We're composing if we have preedit (the obvious case). But we're also
// composing if we don't have preedit and we had marked text before,
// because this input probably just reset the preedit state. It shouldn't
// be encoded. Example: Japanese begin composing, the press backspace.
// This should only cancel the composing state but not actually delete
// the prior input characters (prior to the composing).
composing: markedText.length > 0 || markedTextBefore
)
}
}