Merge pull request #278 from zonble/master

Fixes a typo.
This commit is contained in:
Lukhnos Liu 2022-02-04 09:05:39 -08:00 committed by GitHub
commit 153064ae9f
1 changed files with 7 additions and 6 deletions

View File

@ -571,6 +571,7 @@ extension McBopomofoInputMethodController: CandidateControllerDelegate {
}
func candidateController(_ controller: CandidateController, didSelectCandidateAtIndex index: UInt) {
let client = currentCandidateClient
if let state = state as? InputState.ChoosingCandidate {
let selectedValue = state.candidates[Int(index)]
@ -583,24 +584,24 @@ extension McBopomofoInputMethodController: CandidateControllerDelegate {
if keyHandler.inputMode == .plainBopomofo {
keyHandler.clear()
let composingBuffer = inputting.composingBuffer
handle(state: .Committing(poppedText: composingBuffer), client: currentCandidateClient)
handle(state: .Committing(poppedText: composingBuffer), client: client)
if Preferences.associatedPhrasesEnabled,
let associatePhrases = keyHandler.buildAssociatePhraseState(withKey: composingBuffer, useVerticalMode: state.useVerticalMode) as? InputState.AssociatedPhrases {
self.handle(state: associatePhrases, client: self.currentCandidateClient)
self.handle(state: associatePhrases, client: client)
} else {
handle(state: .Empty(), client: currentDeferredClient)
handle(state: .Empty(), client: client)
}
} else {
handle(state: inputting, client: currentCandidateClient)
handle(state: inputting, client: client)
}
} else if let state = state as? InputState.AssociatedPhrases {
let selectedValue = state.candidates[Int(index)]
handle(state: .Committing(poppedText: selectedValue), client: currentCandidateClient)
if Preferences.associatedPhrasesEnabled,
let associatePhrases = keyHandler.buildAssociatePhraseState(withKey: selectedValue, useVerticalMode: state.useVerticalMode) as? InputState.AssociatedPhrases {
self.handle(state: associatePhrases, client: self.currentCandidateClient)
self.handle(state: associatePhrases, client: client)
} else {
handle(state: .Empty(), client: currentDeferredClient)
handle(state: .Empty(), client: client)
}
}
}