SessionCtl // Add initial char for `%quick` candidates (IMK).

This commit is contained in:
ShikiSuen 2023-06-27 20:31:09 +08:00
parent 633a68b9a1
commit 83eb9da3e1
1 changed files with 6 additions and 2 deletions

View File

@ -14,6 +14,10 @@ import Tekkon
// MARK: - IMKCandidates
public extension SessionCtl {
private var initialCharForQuickCandidates: String {
PrefMgr.shared.useHorizontalCandidateList ? "" : "🗲"
}
/// IMK
/// - Parameter sender: 使
/// - Returns: IMK
@ -55,7 +59,7 @@ public extension SessionCtl {
case .ofAssociates:
handleIMKCandidatesPrepared(state.candidates, prefix: "")
case .ofInputting where state.isCandidateContainer:
handleIMKCandidatesPrepared(state.candidates)
handleIMKCandidatesPrepared(state.candidates, prefix: initialCharForQuickCandidates)
case .ofCandidates:
guard !state.candidates.isEmpty else { return .init() }
if state.candidates[0].keyArray.joined(separator: "-").contains("_punctuation") {
@ -128,7 +132,7 @@ public extension SessionCtl {
case .ofAssociates:
fixIndexForIMKCandidates(&indexDeducted, prefix: "", source: candidateString)
case .ofInputting where state.isCandidateContainer:
fixIndexForIMKCandidates(&indexDeducted, source: candidateString)
fixIndexForIMKCandidates(&indexDeducted, prefix: initialCharForQuickCandidates, source: candidateString)
case .ofSymbolTable:
fixSymbolIndexForIMKCandidates()
case .ofCandidates: