From 08b92ae53b87132fab537df70e73015ab2a05848 Mon Sep 17 00:00:00 2001 From: zonble Date: Fri, 4 Feb 2022 21:39:31 +0800 Subject: [PATCH] Fixes a typo. --- Source/InputMethodController.swift | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Source/InputMethodController.swift b/Source/InputMethodController.swift index c7d79b75..8f91e862 100644 --- a/Source/InputMethodController.swift +++ b/Source/InputMethodController.swift @@ -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) } } }