InputHandler // Do handleBackSpace() correctly with `%quick`.

This commit is contained in:
ShikiSuen 2023-06-21 01:14:45 +08:00
parent 28db2c8e7c
commit f7872810ad
2 changed files with 15 additions and 1 deletions

View File

@ -49,6 +49,12 @@ extension InputHandler {
} }
} }
// MARK: BackSpace
if input.isBackSpace, prefs.cassetteEnabled, state.type == .ofInputting {
return handleBackSpace(input: input)
}
// MARK: (Cancel Candidate) // MARK: (Cancel Candidate)
let cancelCandidateKey = let cancelCandidateKey =

View File

@ -503,7 +503,15 @@ extension InputHandler {
} }
switch isConsideredEmptyForNow { switch isConsideredEmptyForNow {
case false: delegate.switchState(generateStateOfInputting()) case false:
var result = generateStateOfInputting()
// IMK `%quick`
if prefs.cassetteEnabled, !prefs.useIMKCandidateWindow,
let fetched = currentLM.cassetteQuickSetsFor(key: calligrapher)
{
result.candidates = fetched.map { (keyArray: [""], value: $0.description) }
}
delegate.switchState(result)
case true: delegate.switchState(IMEState.ofAbortion()) case true: delegate.switchState(IMEState.ofAbortion())
} }
return true return true