Fixes a typo.

This commit is contained in:
zonble 2022-02-04 21:39:31 +08:00
parent dc24de2ccb
commit 08b92ae53b
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) { func candidateController(_ controller: CandidateController, didSelectCandidateAtIndex index: UInt) {
let client = currentCandidateClient
if let state = state as? InputState.ChoosingCandidate { if let state = state as? InputState.ChoosingCandidate {
let selectedValue = state.candidates[Int(index)] let selectedValue = state.candidates[Int(index)]
@ -583,24 +584,24 @@ extension McBopomofoInputMethodController: CandidateControllerDelegate {
if keyHandler.inputMode == .plainBopomofo { if keyHandler.inputMode == .plainBopomofo {
keyHandler.clear() keyHandler.clear()
let composingBuffer = inputting.composingBuffer let composingBuffer = inputting.composingBuffer
handle(state: .Committing(poppedText: composingBuffer), client: currentCandidateClient) handle(state: .Committing(poppedText: composingBuffer), client: client)
if Preferences.associatedPhrasesEnabled, if Preferences.associatedPhrasesEnabled,
let associatePhrases = keyHandler.buildAssociatePhraseState(withKey: composingBuffer, useVerticalMode: state.useVerticalMode) as? InputState.AssociatedPhrases { 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 { } else {
handle(state: .Empty(), client: currentDeferredClient) handle(state: .Empty(), client: client)
} }
} else { } else {
handle(state: inputting, client: currentCandidateClient) handle(state: inputting, client: client)
} }
} else if let state = state as? InputState.AssociatedPhrases { } else if let state = state as? InputState.AssociatedPhrases {
let selectedValue = state.candidates[Int(index)] let selectedValue = state.candidates[Int(index)]
handle(state: .Committing(poppedText: selectedValue), client: currentCandidateClient) handle(state: .Committing(poppedText: selectedValue), client: currentCandidateClient)
if Preferences.associatedPhrasesEnabled, if Preferences.associatedPhrasesEnabled,
let associatePhrases = keyHandler.buildAssociatePhraseState(withKey: selectedValue, useVerticalMode: state.useVerticalMode) as? InputState.AssociatedPhrases { 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 { } else {
handle(state: .Empty(), client: currentDeferredClient) handle(state: .Empty(), client: client)
} }
} }
} }