From 4db10fb9e3e8ca268913b6d7abf25b0c0c456f35 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Tue, 13 Sep 2022 20:18:52 +0800 Subject: [PATCH] KeyHandler // Fix an issue with length limitation in PCB. --- .../ControllerModules/KeyHandler_HandleInput.swift | 10 ++++++++-- .../Modules/ControllerModules/KeyHandler_States.swift | 5 ++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Source/Modules/ControllerModules/KeyHandler_HandleInput.swift b/Source/Modules/ControllerModules/KeyHandler_HandleInput.swift index 6af1aee1..414fc743 100644 --- a/Source/Modules/ControllerModules/KeyHandler_HandleInput.swift +++ b/Source/Modules/ControllerModules/KeyHandler_HandleInput.swift @@ -174,7 +174,10 @@ extension KeyHandler { } else if currentLM.hasUnigramsFor(key: " ") { compositor.insertKey(" ") walk() - let inputting = buildInputtingState + // 一邊吃一邊屙(僅對位列黑名單的 App 用這招限制組字區長度)。 + let textToCommit = commitOverflownComposition + var inputting = buildInputtingState + inputting.textToCommit = textToCommit stateCallback(inputting) } return true @@ -293,7 +296,10 @@ extension KeyHandler { if composer.isEmpty { compositor.insertKey("_punctuation_list") walk() - let inputting = buildInputtingState + // 一邊吃一邊屙(僅對位列黑名單的 App 用這招限制組字區長度)。 + let textToCommit = commitOverflownComposition + var inputting = buildInputtingState + inputting.textToCommit = textToCommit stateCallback(inputting) stateCallback(buildCandidate(state: inputting)) } else { // 不要在注音沒敲完整的情況下叫出統合符號選單。 diff --git a/Source/Modules/ControllerModules/KeyHandler_States.swift b/Source/Modules/ControllerModules/KeyHandler_States.swift index 0f54b7eb..37c2c223 100644 --- a/Source/Modules/ControllerModules/KeyHandler_States.swift +++ b/Source/Modules/ControllerModules/KeyHandler_States.swift @@ -274,7 +274,10 @@ extension KeyHandler { compositor.insertKey(customPunctuation) walk() - let inputting = buildInputtingState + // 一邊吃一邊屙(僅對位列黑名單的 App 用這招限制組字區長度)。 + let textToCommit = commitOverflownComposition + var inputting = buildInputtingState + inputting.textToCommit = textToCommit stateCallback(inputting) // 從這一行之後開始,就是針對逐字選字模式的單獨處理。