From 983addb7f1c245102bfaf427ac636b0aea780816 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Thu, 10 Mar 2022 17:30:15 +0800 Subject: [PATCH] ctlIME // Add converted userPhrase to the neighbored input mode. --- Source/Modules/IMEModules/ctlInputMethod.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/Modules/IMEModules/ctlInputMethod.swift b/Source/Modules/IMEModules/ctlInputMethod.swift index 13604d5d..56f485ed 100644 --- a/Source/Modules/IMEModules/ctlInputMethod.swift +++ b/Source/Modules/IMEModules/ctlInputMethod.swift @@ -659,7 +659,9 @@ extension ctlInputMethod: KeyHandlerDelegate { if !state.validToWrite { return false } + let InputModeReversed: InputMode = (ctlInputMethod.currentKeyHandler.inputMode == InputMode.imeModeCHT) ? InputMode.imeModeCHS : InputMode.imeModeCHT mgrLangModel.writeUserPhrase(state.userPhrase, inputMode: keyHandler.inputMode, areWeDuplicating: state.chkIfUserPhraseExists) + mgrLangModel.writeUserPhrase(state.userPhraseConverted, inputMode: InputModeReversed, areWeDuplicating: false) return true } }