KeyHandler // Improve Alt+Fwd/Bwd support.

This commit is contained in:
ShikiSuen 2022-07-12 15:55:18 +08:00
parent c89636e12a
commit 5f654c842e
2 changed files with 10 additions and 13 deletions

View File

@ -375,8 +375,8 @@ class KeyHandler {
///
var compositorCursorIndex: Int {
get { compositor.cursorIndex }
set { compositor.cursorIndex = newValue }
get { compositor.cursor }
set { compositor.cursor = newValue }
}
///

View File

@ -662,14 +662,14 @@ extension KeyHandler {
stateCallback(state)
}
} else if input.isOptionHold {
if compositorCursorIndex < compositorLength {
compositorCursorIndex = nextPhrasePosition
stateCallback(buildInputtingState)
} else {
//
if !compositor.jumpCursorBySpan(to: .front) {
IME.prtDebugIntel("33C3B580")
errorCallback()
stateCallback(state)
return true
}
stateCallback(buildInputtingState)
} else {
if compositorCursorIndex < compositorLength {
compositorCursorIndex += 1
@ -727,17 +727,14 @@ extension KeyHandler {
stateCallback(state)
}
} else if input.isOptionHold {
if compositorCursorIndex > 1 {
compositorCursorIndex -= 2
stateCallback(buildInputtingState)
} else if compositorCursorIndex == 1 {
compositorCursorIndex = 0
stateCallback(buildInputtingState)
} else {
//
if !compositor.jumpCursorBySpan(to: .rear) {
IME.prtDebugIntel("8D50DD9E")
errorCallback()
stateCallback(state)
return true
}
stateCallback(buildInputtingState)
} else {
if compositorCursorIndex > 0 {
compositorCursorIndex -= 1