mirror of
https://github.com/keymanapp/keyman.git
synced 2026-10-15 02:17:32 +00:00
fix(android): Skip if there's no left context to delete
This commit is contained in:
parent
95c0206309
commit
8a74b8aa90
1 changed files with 6 additions and 1 deletions
|
|
@ -318,12 +318,17 @@ public final class KMManager {
|
|||
private static void performLeftDeletions(InputConnection ic, int dn) {
|
||||
int originalBufferLength = dn*2 + 16; // characters
|
||||
CharSequence charsBackup = ic.getTextBeforeCursor(originalBufferLength, 0);
|
||||
int lastIndex = charsBackup.length()-1;
|
||||
|
||||
// Exit if there's no context to delete
|
||||
if (lastIndex < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Count the number of surrogate pairs in this buffer, backwards from the end
|
||||
// until we reach dn codepoints.
|
||||
// Unfortunately, can't foreach charSequence in reverse
|
||||
int numPairs = 0;
|
||||
int lastIndex = charsBackup.length()-1;
|
||||
int counter=0;
|
||||
try {
|
||||
do {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue