diff --git a/Source/Modules/ControllerModules/ctlInputMethod_Core.swift b/Source/Modules/ControllerModules/ctlInputMethod_Core.swift index 9806ad28..931324f8 100644 --- a/Source/Modules/ControllerModules/ctlInputMethod_Core.swift +++ b/Source/Modules/ControllerModules/ctlInputMethod_Core.swift @@ -311,7 +311,13 @@ class ctlInputMethod: IMKInputController { /// IMK 選字窗限定函式,只要選字窗內的高亮內容選擇出現變化了、就會呼叫這個函式。 /// - Parameter _: 已經高亮選中的候選字詞內容。 override open func candidateSelectionChanged(_: NSAttributedString!) { - // 暫時不需要擴充這個函式。但有些幹話還是要講的: + // 警告:不要考慮用實作這個函式的方式來更新內文組字區的顯示。 + // 因為這樣會導致 IMKServer.commitCompositionWithReply() 呼叫你本來不想呼叫的 commitComposition(), + // 然後 keyHandler 會被重設,屆時輸入法會在狀態處理等方面崩潰掉。 + + // 這個函式的實作其實很容易誘發各種崩潰,所以最好不要輕易實作。 + + // 有些幹話還是要講的: // 在這個函式當中試圖(無論是否拿著傳入的參數)從 ctlCandidateIMK 找 identifier 的話, // 只會找出 NSNotFound。你想 NSLog 列印看 identifier 是多少,輸入法直接崩潰。 // 而且會他媽的崩得連 console 內的 ips 錯誤報告都沒有。 diff --git a/Source/Modules/ControllerModules/ctlInputMethod_HandleStates.swift b/Source/Modules/ControllerModules/ctlInputMethod_HandleStates.swift index f8007559..7829288c 100644 --- a/Source/Modules/ControllerModules/ctlInputMethod_HandleStates.swift +++ b/Source/Modules/ControllerModules/ctlInputMethod_HandleStates.swift @@ -46,7 +46,7 @@ extension ctlInputMethod { } /// 針對受 .NotEmpty() 管轄的非空狀態,在組字區內顯示游標。 - private func setInlineDisplayWithCursor() { + func setInlineDisplayWithCursor() { guard let client = client() else { return } if let state = state as? InputState.AssociatedPhrases { client.setMarkedText(