IMKCandidates // Patch highlightedIndex().
This commit is contained in:
parent
234c2656b7
commit
8dc7c027fc
|
@ -14,6 +14,7 @@ public protocol CtlCandidateDelegate {
|
|||
func candidatePairHighlightChanged(at index: Int)
|
||||
func candidatePairRightClicked(at index: Int, action: CandidateContextMenuAction)
|
||||
func candidates(_ sender: Any!) -> [Any]!
|
||||
func deductCandidateIndex(from candidateString: String) -> Int
|
||||
func resetCandidateWindowOrigin()
|
||||
@discardableResult func reverseLookup(for value: String) -> [String]
|
||||
var selectionKeys: String { get }
|
||||
|
|
|
@ -148,7 +148,11 @@ public class CtlCandidateIMK: IMKCandidates, CtlCandidateProtocol {
|
|||
public func candidateIndexAtKeyLabelIndex(_: Int) -> Int? { 0 }
|
||||
|
||||
public var highlightedIndex: Int {
|
||||
get { selectedCandidate() }
|
||||
get {
|
||||
let returned = selectedCandidate()
|
||||
guard let strCurrentCandidate = selectedCandidateString() else { return returned }
|
||||
return delegate?.deductCandidateIndex(from: strCurrentCandidate.string) ?? returned
|
||||
}
|
||||
set { selectCandidate(withIdentifier: newValue) }
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue