ctlIME // Turn dealt EmptyIgnoringPreviousState to Empty().
This commit is contained in:
parent
6ad6c73bc3
commit
c79c4aeb2e
|
@ -71,7 +71,7 @@ protocol InputStateProtocol {
|
|||
/// - .Empty: 使用者剛剛切換至該輸入法、卻還沒有任何輸入行為。抑或是剛剛敲字遞交給
|
||||
/// 客體應用、準備新的輸入行為。
|
||||
/// - .EmptyIgnorePreviousState: 與 Empty 類似,但會扔掉上一個狀態的內容、不將這些
|
||||
/// 內容遞交給客體應用。
|
||||
/// 內容遞交給客體應用。該狀態在處理完畢之後會被立刻切換至 .Empty()。
|
||||
/// - .Committing: 該狀態會承載要遞交出去的內容,讓輸入法控制器處理時代為遞交。
|
||||
/// - .NotEmpty: 非空狀態,是一種狀態大類、用以派生且代表下述諸狀態。
|
||||
/// - .Inputting: 使用者輸入了內容。此時會出現組字區(Compositor)。
|
||||
|
@ -108,6 +108,7 @@ enum InputState {
|
|||
|
||||
/// .EmptyIgnorePreviousState: 與 Empty 類似,
|
||||
/// 但會扔掉上一個狀態的內容、不將這些內容遞交給客體應用。
|
||||
/// 該狀態在處理完畢之後會被立刻切換至 .Empty()。
|
||||
class EmptyIgnoringPreviousState: Empty {
|
||||
override public var type: StateType { .ofEmptyIgnorePreviousState }
|
||||
override var description: String {
|
||||
|
|
|
@ -369,9 +369,8 @@ extension ctlInputMethod {
|
|||
) {
|
||||
_ = state // 防止格式整理工具毀掉與此對應的參數。
|
||||
_ = previous // 防止格式整理工具毀掉與此對應的參數。
|
||||
ctlCandidateCurrent.visible = false
|
||||
hideTooltip()
|
||||
clearInlineDisplay()
|
||||
// 這個函式就是去掉 previous state 使得沒有任何東西可以 commit。
|
||||
handle(state: InputState.Empty())
|
||||
}
|
||||
|
||||
private func handle(state: InputState.Committing, previous: InputStateProtocol) {
|
||||
|
|
Loading…
Reference in New Issue