diff options
author | 2014-02-17 03:48:50 -0800 | |
---|---|---|
committer | 2014-02-17 03:48:50 -0800 | |
commit | 5828d1f3fa4e3590297b432e003946b502ecfbd6 (patch) | |
tree | 8a5710296b99e8cc2bf59c7f330f2c58ba03d1d0 /java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java | |
parent | daf28b45a4367b6877e895e8e8e43c6df1187074 (diff) | |
parent | 782c9fee6bcb32d67c8ee9faa7e5c9dfb091afd3 (diff) | |
download | latinime-5828d1f3fa4e3590297b432e003946b502ecfbd6.tar.gz latinime-5828d1f3fa4e3590297b432e003946b502ecfbd6.tar.xz latinime-5828d1f3fa4e3590297b432e003946b502ecfbd6.zip |
am 782c9fee: Merge "Don\'t resume suggestion on links."
* commit '782c9fee6bcb32d67c8ee9faa7e5c9dfb091afd3':
Don't resume suggestion on links.
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(); |