InputHandler // Fix a conversion error in handleCtrlCommandEnter().

This commit is contained in:
ShikiSuen 2022-10-30 15:35:56 +08:00
parent 5ae6fc9841
commit 27063a6430
1 changed files with 3 additions and 4 deletions

View File

@ -291,15 +291,14 @@ extension InputHandler {
let state = delegate.state let state = delegate.state
guard state.type == .ofInputting else { return false } guard state.type == .ofInputting else { return false }
var displayedText = compositor.keys.joined(separator: " ") var displayedText = compositor.keys.joined(separator: "\t")
if prefs.inlineDumpPinyinInLieuOfZhuyin, !prefs.cassetteEnabled { if prefs.inlineDumpPinyinInLieuOfZhuyin, !prefs.cassetteEnabled {
displayedText = Tekkon.restoreToneOneInZhuyinKey(target: displayedText) // displayedText = Tekkon.restoreToneOneInZhuyinKey(target: displayedText) //
displayedText = Tekkon.cnvPhonaToHanyuPinyin(target: displayedText) // displayedText = Tekkon.cnvPhonaToHanyuPinyin(target: displayedText) //
} }
if delegate.clientBundleIdentifier.contains("vChewingPhraseEditor") { let isVCED = delegate.clientBundleIdentifier.contains("vChewingPhraseEditor")
displayedText = displayedText.replacingOccurrences(of: " ", with: "-") displayedText = displayedText.replacingOccurrences(of: "\t", with: isVCED ? "-" : " ")
}
delegate.switchState(IMEState.ofCommitting(textToCommit: displayedText)) delegate.switchState(IMEState.ofCommitting(textToCommit: displayedText))
return true return true