diff --git a/Source/Modules/InputHandler_Core.swift b/Source/Modules/InputHandler_Core.swift index 72ee8bd5..afbe8b6e 100644 --- a/Source/Modules/InputHandler_Core.swift +++ b/Source/Modules/InputHandler_Core.swift @@ -111,6 +111,9 @@ public class InputHandler: InputHandlerProtocol { isCodePointInputMode = false } + /// 警告:該參數僅代指組音區/組筆區域與組字區在目前狀態下被視為「空」。 + var isConsideredEmptyForNow: Bool { compositor.isEmpty && isComposerOrCalligrapherEmpty } + // MARK: - Hanin Keyboard Symbol Mode. var isHaninKeyboardSymbolMode = false diff --git a/Source/Modules/InputHandler_HandleStates.swift b/Source/Modules/InputHandler_HandleStates.swift index d674e884..a6375049 100644 --- a/Source/Modules/InputHandler_HandleStates.swift +++ b/Source/Modules/InputHandler_HandleStates.swift @@ -19,6 +19,7 @@ extension InputHandler { /// 生成「正在輸入」狀態。相關的內容會被拿給狀態機械用來處理在電腦螢幕上顯示的內容。 public func generateStateOfInputting(sansReading: Bool = false) -> IMEStateProtocol { + if isConsideredEmptyForNow { return IMEState.ofAbortion() } let cpInput = isCodePointInputMode && !sansReading /// 「更新內文組字區 (Update the composing buffer)」是指要求客體軟體將組字緩衝區的內容 /// 換成由此處重新生成的原始資料在 IMEStateData 當中生成的 NSAttributeString。