Skip to content

Commit 1c134f1

Browse files
committed
Fixed termux issue
1 parent 637f069 commit 1c134f1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/src/main/kotlin/com/simplemobiletools/keyboard/services/SimpleKeyboardIME.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ class SimpleKeyboardIME : InputMethodService(), OnKeyboardActionListener, Shared
163163

164164
else -> {
165165
var codeChar = code.toChar()
166-
val originalText = inputConnection.getExtractedText(ExtractedTextRequest(), 0)?.text ?: return
167166

168167
if (Character.isLetter(codeChar) && keyboard!!.mShiftState > ShiftState.OFF) {
169168
codeChar = Character.toUpperCase(codeChar)
@@ -173,6 +172,7 @@ class SimpleKeyboardIME : InputMethodService(), OnKeyboardActionListener, Shared
173172
// However, avoid doing that in cases when the EditText for example requires numbers as the input.
174173
// We can detect that by the text not changing on pressing Space.
175174
if (keyboardMode != KEYBOARD_LETTERS && inputTypeClass == TYPE_CLASS_TEXT && code == MyKeyboard.KEYCODE_SPACE) {
175+
val originalText = inputConnection.getExtractedText(ExtractedTextRequest(), 0)?.text
176176
inputConnection.commitText(codeChar.toString(), 1)
177177
val newText = inputConnection.getExtractedText(ExtractedTextRequest(), 0)?.text
178178
if (originalText != newText) {

0 commit comments

Comments
 (0)