InputHandler // Deduplicate `%quick` results for IMKCandidates.
This commit is contained in:
parent
b33d89abec
commit
723437d085
|
@ -271,8 +271,13 @@ extension InputHandler {
|
|||
|
||||
if !isStrokesFull {
|
||||
var result = generateStateOfInputting()
|
||||
if !calligrapher.isEmpty, let fetched = currentLM.cassetteQuickSetsFor(key: calligrapher) {
|
||||
result.candidates = fetched.map { (keyArray: [""], value: $0.description) }
|
||||
if !calligrapher.isEmpty, var fetched = currentLM.cassetteQuickSetsFor(key: calligrapher) {
|
||||
if prefs.useIMKCandidateWindow {
|
||||
fetched = fetched.deduplicated.filter { $0.description != currentLM.nullCandidateInCassette }
|
||||
}
|
||||
result.candidates = fetched.enumerated().map {
|
||||
(keyArray: [$0.offset.description], value: $0.element.description)
|
||||
}
|
||||
}
|
||||
delegate.switchState(result)
|
||||
return true
|
||||
|
|
|
@ -507,8 +507,13 @@ extension InputHandler {
|
|||
switch isConsideredEmptyForNow {
|
||||
case false:
|
||||
var result = generateStateOfInputting()
|
||||
if prefs.cassetteEnabled, let fetched = currentLM.cassetteQuickSetsFor(key: calligrapher) {
|
||||
result.candidates = fetched.map { (keyArray: [""], value: $0.description) }
|
||||
if prefs.cassetteEnabled, var fetched = currentLM.cassetteQuickSetsFor(key: calligrapher) {
|
||||
if prefs.useIMKCandidateWindow {
|
||||
fetched = fetched.deduplicated.filter { $0.description != currentLM.nullCandidateInCassette }
|
||||
}
|
||||
result.candidates = fetched.enumerated().map {
|
||||
(keyArray: [$0.offset.description], value: $0.element.description)
|
||||
}
|
||||
}
|
||||
delegate.switchState(result)
|
||||
case true: delegate.switchState(IMEState.ofAbortion())
|
||||
|
|
Loading…
Reference in New Issue