From 17da7f83cff5228ad7e81228ef744de4afdd84cf Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Thu, 9 Feb 2023 23:47:45 +0800 Subject: [PATCH] SessionCtl // Ensure a state switch when resetInputHandler(). --- Source/Modules/SessionCtl_Core.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Modules/SessionCtl_Core.swift b/Source/Modules/SessionCtl_Core.swift index f433f23f..a1b30f6e 100644 --- a/Source/Modules/SessionCtl_Core.swift +++ b/Source/Modules/SessionCtl_Core.swift @@ -200,12 +200,12 @@ public extension SessionCtl { // 過濾掉尚未完成拼寫的注音。 let sansReading: Bool = (state.type == .ofInputting) && (PrefMgr.shared.trimUnfinishedReadingsOnCommit || forceCleanup) - textToCommit = inputHandler.generateStateOfInputting(sansReading: sansReading).displayedText + if state.hasComposition { + textToCommit = inputHandler.generateStateOfInputting(sansReading: sansReading).displayedText + } // 威注音不再在這裡對 IMKTextInput 客體黑名單當中的應用做資安措施。 // 有相關需求者,請在切換掉輸入法或者切換至新的客體應用之前敲一下 Shift+Delete。 - if !inputHandler.isCompositorEmpty { - switchState(IMEState.ofCommitting(textToCommit: textToCommit)) - } + switchState(IMEState.ofCommitting(textToCommit: textToCommit)) } }