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