File tree Expand file tree Collapse file tree
app/src/main/java/com/osfans/trime Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,9 +46,6 @@ class Rime :
4646 override var menuCached = RimeProto .Context .Menu ()
4747 private set
4848
49- override var rawInputCached = " "
50- private set
51-
5249 private val dispatcher =
5350 RimeDispatcher (
5451 object : RimeDispatcher .RimeController {
@@ -263,7 +260,6 @@ class Rime :
263260 }
264261 is RimeMessage .CompositionMessage -> {
265262 compositionCached = it.data
266- rawInputCached = getRimeRawInput()
267263 }
268264 is RimeMessage .CandidateMenuMessage -> menuCached = it.data
269265 is RimeMessage .StatusMessage -> {
Original file line number Diff line number Diff line change @@ -20,8 +20,6 @@ interface RimeApi {
2020
2121 val menuCached: RimeProto .Context .Menu
2222
23- val rawInputCached: String
24-
2523 suspend fun isEmpty (): Boolean
2624
2725 suspend fun deploy ()
Original file line number Diff line number Diff line change @@ -15,5 +15,4 @@ enum class ComposingTextMode(
1515 DISABLE (R .string.disable),
1616 PREEDIT (R .string.preedit),
1717 COMMIT_TEXT_PREVIEW (R .string.commit_text_preview),
18- RAW_INPUT (R .string.raw_input),
1918}
Original file line number Diff line number Diff line change @@ -881,15 +881,14 @@ open class TrimeInputMethodService : LifecycleInputMethodService() {
881881 ComposingTextMode .DISABLE -> " "
882882 ComposingTextMode .PREEDIT -> composition.preedit ? : " "
883883 ComposingTextMode .COMMIT_TEXT_PREVIEW -> composition.commitTextPreview ? : " "
884- ComposingTextMode .RAW_INPUT -> rime.run { rawInputCached }
885884 }
886885 if (ic.getSelectedText(0 ).isNullOrEmpty() || text.isNotEmpty()) {
887886 ic.setComposingText(text, 1 )
888887 }
889888 }
890889
891890 fun getActiveText (type : Int ): String {
892- if (type == 2 ) return rime.run { rawInputCached } // 當前編碼
891+ if (type == 2 ) return rime.run { compositionCached }.preedit ? : " " // 當前編碼
893892 var text: CharSequence? = rime.run { compositionCached }.commitTextPreview // 當前候選
894893 if (text.isNullOrEmpty()) {
895894 val info = currentInputEditorInfo
You can’t perform that action at this time.
0 commit comments