diff options
author | 2011-05-14 06:04:42 +0900 | |
---|---|---|
committer | 2011-05-14 06:04:42 +0900 | |
commit | dfd66f19edf1e1d97a0bf83dd20b99ee8bfae35e (patch) | |
tree | 903064275b4784e5d86bd95b3ccb2fe026ff39c3 /java/src/com/android | |
parent | e558bb053de9763fffcbd49fdcf067148580f328 (diff) | |
parent | 1f050f634820a1d980e8a91f3a962bcd1fc242e3 (diff) | |
download | latinime-dfd66f19edf1e1d97a0bf83dd20b99ee8bfae35e.tar.gz latinime-dfd66f19edf1e1d97a0bf83dd20b99ee8bfae35e.tar.xz latinime-dfd66f19edf1e1d97a0bf83dd20b99ee8bfae35e.zip |
Merge remote-tracking branch 'goog/master' into merge
Diffstat (limited to 'java/src/com/android')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 964dd99ca..2c39eba55 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -1553,7 +1553,9 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar // a magic space even if it was a normal space. This is meant to help in case the user // pressed space on purpose of displaying the suggestion strip punctuation. final char primaryCode = suggestion.charAt(0); - final int toLeft = (ic == null) ? 0 : ic.getTextBeforeCursor(1, 0).charAt(0); + final CharSequence beforeText = ic.getTextBeforeCursor(1, 0); + final int toLeft = (ic == null || TextUtils.isEmpty(beforeText)) + ? 0 : beforeText.charAt(0); final boolean oldMagicSpace = mJustAddedMagicSpace; if (Keyboard.CODE_SPACE == toLeft) mJustAddedMagicSpace = true; onCodeInput(primaryCode, new int[] { primaryCode }, |