don't append text if there is no text

fixes #389
bug was present also in old versions, but only exposed due to possibilty of using arrow keys
This commit is contained in:
Helium314 2024-01-07 08:42:26 +01:00
parent 7758f125a5
commit 545991260b

View file

@ -559,7 +559,10 @@ public final class RichInputConnection implements PrivateCommandPerformer {
}
break;
default:
final String text = StringUtils.newSingleCodePointString(keyEvent.getUnicodeChar());
final int codePoint = keyEvent.getUnicodeChar();
if (Character.isISOControl(codePoint))
break; // don't append text if there is no actual text
final String text = StringUtils.newSingleCodePointString(codePoint);
mCommittedTextBeforeComposingText.append(text);
mExpectedSelStart += text.length();
mExpectedSelEnd = mExpectedSelStart;