diff options
author | 2013-01-09 01:53:47 -0800 | |
---|---|---|
committer | 2013-01-09 01:53:47 -0800 | |
commit | b112a13518fd7479da4113d8e4f4f327ad8b9bbb (patch) | |
tree | 5701c793eb829ab18297af620a53d4d861d7e12e /java/src | |
parent | e56686f43af81db965941a393c5e0231c26ec77b (diff) | |
parent | 516b63db2866f144a00ec7e1e6c29cb0865f5ff3 (diff) | |
download | latinime-b112a13518fd7479da4113d8e4f4f327ad8b9bbb.tar.gz latinime-b112a13518fd7479da4113d8e4f4f327ad8b9bbb.tar.xz latinime-b112a13518fd7479da4113d8e4f4f327ad8b9bbb.zip |
Merge "Fix a race condition with backspaces"
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 6eeee9c2a..3b0112b27 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -1717,6 +1717,11 @@ public final class LatinIME extends InputMethodService implements KeyboardAction // If there is a selection, remove it. final int lengthToDelete = mLastSelectionEnd - mLastSelectionStart; mConnection.setSelection(mLastSelectionEnd, mLastSelectionEnd); + // Reset mLastSelectionEnd to mLastSelectionStart. This is what is supposed to + // happen, and if it's wrong, the next call to onUpdateSelection will correct it, + // but we want to set it right away to avoid it being used with the wrong values + // later (typically, in a subsequent press on backspace). + mLastSelectionEnd = mLastSelectionStart; mConnection.deleteSurroundingText(lengthToDelete, 0); } else { // There is no selection, just delete one character. |