TDKCandidates // Force-refresh reverse lookup results on refresh.
This commit is contained in:
parent
63f7cc91fc
commit
b20dfec630
|
@ -112,6 +112,9 @@ public class CtlCandidateTDK: CtlCandidate, NSWindowDelegate {
|
||||||
guard let self = self else { return }
|
guard let self = self else { return }
|
||||||
self.updateNSWindowModern(window)
|
self.updateNSWindowModern(window)
|
||||||
}
|
}
|
||||||
|
// 先擦除之前的反查结果。
|
||||||
|
reverseLookupResult = []
|
||||||
|
// 再更新新的反查结果。
|
||||||
if let currentCandidate = Self.thePool.currentCandidate {
|
if let currentCandidate = Self.thePool.currentCandidate {
|
||||||
let displayedText = currentCandidate.displayedText
|
let displayedText = currentCandidate.displayedText
|
||||||
var lookupResult: [String?] = delegate?.reverseLookup(for: displayedText) ?? []
|
var lookupResult: [String?] = delegate?.reverseLookup(for: displayedText) ?? []
|
||||||
|
@ -128,8 +131,8 @@ public class CtlCandidateTDK: CtlCandidate, NSWindowDelegate {
|
||||||
reverseLookupResult = [lookupResult.compactMap { $0 }.first].compactMap { $0 }
|
reverseLookupResult = [lookupResult.compactMap { $0 }.first].compactMap { $0 }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Self.thePool.reverseLookupResult = reverseLookupResult
|
|
||||||
}
|
}
|
||||||
|
Self.thePool.reverseLookupResult = reverseLookupResult
|
||||||
Self.thePool.tooltip = delegate?.candidateToolTip(shortened: !Self.thePool.isMatrix) ?? ""
|
Self.thePool.tooltip = delegate?.candidateToolTip(shortened: !Self.thePool.isMatrix) ?? ""
|
||||||
delegate?.candidatePairHighlightChanged(at: highlightedIndex)
|
delegate?.candidatePairHighlightChanged(at: highlightedIndex)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue