SessionCtl // Tweak resetInputHandler().

This commit is contained in:
ShikiSuen 2022-11-25 11:09:55 +08:00
parent 8043bd683c
commit 850a48b883
1 changed files with 7 additions and 5 deletions

View File

@ -184,14 +184,16 @@ extension SessionCtl {
/// 調
public func resetInputHandler(forceComposerCleanup forceCleanup: Bool = false) {
var textToCommit = ""
//
if state.type == .ofInputting, PrefMgr.shared.trimUnfinishedReadingsOnCommit || forceCleanup {
inputHandler.clearComposerAndCalligrapher()
}
let sansReading: Bool =
(state.type == .ofInputting) && (PrefMgr.shared.trimUnfinishedReadingsOnCommit || forceCleanup)
textToCommit = inputHandler.generateStateOfInputting(sansReading: sansReading).displayedText
// IMKTextInput
// Shift+Delete
switchState(IMEState.ofCommitting(textToCommit: inputHandler.generateStateOfInputting().displayedText))
// switchState(isSecureMode ? IMEState.ofAbortion() : IMEState.ofEmpty())
if !inputHandler.isCompositorEmpty {
switchState(IMEState.ofCommitting(textToCommit: textToCommit))
}
}
}