Skip to content

Commit 9135e57

Browse files
committed
fix: composing state didn't get update in time again
1 parent 20ea880 commit 9135e57

File tree

5 files changed

+3
-9
lines changed

5 files changed

+3
-9
lines changed

app/src/main/java/com/osfans/trime/core/Rime.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ class Rime :
4646
override var compositionCached = RimeProto.Context.Composition()
4747
private set
4848

49-
override var isComposing: Boolean = false
50-
private set
51-
5249
override var hasMenu: Boolean = false
5350
private set
5451

@@ -290,7 +287,6 @@ class Rime :
290287
}
291288
is RimeMessage.CompositionMessage -> {
292289
val composition = it.data
293-
isComposing = composition.length > 0
294290
compositionCached = composition
295291
}
296292
is RimeMessage.CandidateMenuMessage -> {

app/src/main/java/com/osfans/trime/core/RimeApi.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ interface RimeApi {
1818

1919
val compositionCached: RimeProto.Context.Composition
2020

21-
val isComposing: Boolean
22-
2321
val hasMenu: Boolean
2422

2523
val paging: Boolean

app/src/main/java/com/osfans/trime/ime/core/TrimeInputMethodService.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ open class TrimeInputMethodService : LifecycleInputMethodService() {
422422
if (newSelStart != newSelEnd) return
423423
if (candidatesStart == candidatesEnd) {
424424
postRimeJob {
425-
if (isComposing) {
425+
if (statusCached.isComposing) {
426426
Timber.d("handleCursorUpdate: commit composition")
427427
commitComposition()
428428
}

app/src/main/java/com/osfans/trime/ime/keyboard/Key.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ class Key(
217217
val asciiMode = rime.run { statusCached }.isAsciiMode
218218
val paging = rime.run { paging }
219219
val hasMenu = rime.run { hasMenu }
220-
val composing = rime.run { isComposing }
220+
val composing = rime.run { statusCached }.isComposing
221221
return keyActions[KeyBehavior.ASCII].takeIf { asciiMode }
222222
?: keyActions[KeyBehavior.PAGING]?.takeIf { paging }
223223
?: keyActions[KeyBehavior.HAS_MENU]?.takeIf { hasMenu }

app/src/main/java/com/osfans/trime/ime/keyboard/KeyAction.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class KeyAction(
9595
}
9696
if (keyboard.isOnlyShiftOn) {
9797
val asciiMode = rime.run { statusCached }.isAsciiMode
98-
val composing = rime.run { isComposing }
98+
val composing = rime.run { statusCached }.isComposing
9999
if (!hookShiftNum && !composing && code in KeyEvent.KEYCODE_0..KeyEvent.KEYCODE_9) {
100100
return adjustCase(shiftLabel, keyboard)
101101
}

0 commit comments

Comments
 (0)