diff options
author | 2014-02-17 17:53:15 +0900 | |
---|---|---|
committer | 2014-02-17 20:36:16 +0900 | |
commit | 7a7aeffcdcf1f25abdc3923e81fa19c2258fa9e9 (patch) | |
tree | f14239d7f6b9add8d18b11a091c6250d4fc7a1a9 /java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java | |
parent | 1e9897b0c77b858ae479d531732b6795aaf0b2de (diff) | |
download | latinime-7a7aeffcdcf1f25abdc3923e81fa19c2258fa9e9.tar.gz latinime-7a7aeffcdcf1f25abdc3923e81fa19c2258fa9e9.tar.xz latinime-7a7aeffcdcf1f25abdc3923e81fa19c2258fa9e9.zip |
Don't resume suggestion on links.
Bug: 11447084
Change-Id: I5bd558b9dd85d1505aa918f44e8ac3e52ec42d97
Diffstat (limited to 'java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java index 6f73859e8..9bf9d1f45 100644 --- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java +++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java @@ -1270,6 +1270,10 @@ public final class InputLogic { if (range.length() <= 0) return; // Race condition. No text to resume on, so bail out. // If for some strange reason (editor bug or so) we measure the text before the cursor as // longer than what the entire text is supposed to be, the safe thing to do is bail out. + if (range.mHasUrlSpans) return; // If there are links, we don't resume suggestions. Making + // edits to a linkified text through batch commands would ruin the URL spans, and unless + // we take very complicated steps to preserve the whole link, we can't do things right so + // we just do not resume because it's safer. final int numberOfCharsInWordBeforeCursor = range.getNumberOfCharsInWordBeforeCursor(); if (numberOfCharsInWordBeforeCursor > expectedCursorPosition) return; final ArrayList<SuggestedWordInfo> suggestions = CollectionUtils.newArrayList(); |