From 7a7aeffcdcf1f25abdc3923e81fa19c2258fa9e9 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Mon, 17 Feb 2014 17:53:15 +0900 Subject: Don't resume suggestion on links. Bug: 11447084 Change-Id: I5bd558b9dd85d1505aa918f44e8ac3e52ec42d97 --- java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java') 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 suggestions = CollectionUtils.newArrayList(); -- cgit v1.2.3-83-g751a