Repo // Clear calligrapher together on resetInputHandler() (#210)
This commit is contained in:
parent
7c4f141286
commit
ba3e1a99a5
|
@ -22,7 +22,9 @@ public protocol InputHandlerProtocol {
|
|||
var currentUOM: vChewingLM.LMUserOverride { get set }
|
||||
var delegate: InputHandlerDelegate? { get set }
|
||||
var composer: Tekkon.Composer { get set }
|
||||
var isComposerUsingPinyin: Bool { get }
|
||||
func clear()
|
||||
func clearComposerAndCalligrapher()
|
||||
func ensureKeyboardParser()
|
||||
func handleEvent(_ event: NSEvent) -> Bool
|
||||
func generateStateOfInputting() -> IMEStateProtocol
|
||||
|
@ -82,9 +84,8 @@ public class InputHandler: InputHandlerProtocol {
|
|||
}
|
||||
|
||||
public func clear() {
|
||||
composer.clear()
|
||||
clearComposerAndCalligrapher()
|
||||
compositor.clear()
|
||||
calligrapher.removeAll()
|
||||
}
|
||||
|
||||
// MARK: - Functions dealing with Megrez.
|
||||
|
@ -367,8 +368,11 @@ public class InputHandler: InputHandlerProtocol {
|
|||
composer.phonabetCombinationCorrectionEnabled = prefs.autoCorrectReadingCombination
|
||||
}
|
||||
|
||||
func clearComposerAndCalligrapher() {
|
||||
_ = prefs.cassetteEnabled ? calligrapher.removeAll() : composer.clear()
|
||||
public var isComposerUsingPinyin: Bool { composer.parser.rawValue >= 100 }
|
||||
|
||||
public func clearComposerAndCalligrapher() {
|
||||
calligrapher.removeAll()
|
||||
composer.clear()
|
||||
}
|
||||
|
||||
func letComposerAndCalligrapherDoBackSpace() {
|
||||
|
|
|
@ -169,7 +169,7 @@ extension SessionCtl {
|
|||
public func resetInputHandler() {
|
||||
// 過濾掉尚未完成拼寫的注音。
|
||||
if state.type == .ofInputting, PrefMgr.shared.trimUnfinishedReadingsOnCommit {
|
||||
inputHandler.composer.clear()
|
||||
inputHandler.clearComposerAndCalligrapher()
|
||||
switchState(inputHandler.generateStateOfInputting())
|
||||
}
|
||||
// 威注音不再在這裡對 IMKTextInput 客體黑名單當中的應用做資安措施。
|
||||
|
|
|
@ -117,7 +117,7 @@ extension SessionCtl {
|
|||
}
|
||||
|
||||
// 在啟用注音排列而非拼音輸入的情況下,強制將當前鍵盤佈局翻譯為美規鍵盤。
|
||||
if inputHandler.composer.parser.rawValue < 100 || IMKHelper.isDynamicBasicKeyboardLayoutEnabled {
|
||||
if !inputHandler.isComposerUsingPinyin || IMKHelper.isDynamicBasicKeyboardLayoutEnabled {
|
||||
eventToDeal = eventToDeal.inAppleABCStaticForm
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue