Loading core/java/android/widget/Editor.java +7 −1 Original line number Diff line number Diff line Loading @@ -2754,7 +2754,13 @@ public class Editor { // Restore previous SuggestionSpans final int realSuggestionLength = mTextView.getText().toString().length(); final int lengthDifference = realSuggestionLength - (spanEnd - spanStart); int lengthDifference = suggestion.length() - (spanEnd - spanStart); final int realSuggestionDiff = realSuggestionLength - (spanEnd - spanStart); if (realSuggestionDiff < lengthDifference) { lengthDifference = realSuggestionDiff; } for (int i = 0; i < length; i++) { // Only spans that include the modified region make sense after replacement // Spans partially included in the replaced region are removed, there is no Loading Loading
core/java/android/widget/Editor.java +7 −1 Original line number Diff line number Diff line Loading @@ -2754,7 +2754,13 @@ public class Editor { // Restore previous SuggestionSpans final int realSuggestionLength = mTextView.getText().toString().length(); final int lengthDifference = realSuggestionLength - (spanEnd - spanStart); int lengthDifference = suggestion.length() - (spanEnd - spanStart); final int realSuggestionDiff = realSuggestionLength - (spanEnd - spanStart); if (realSuggestionDiff < lengthDifference) { lengthDifference = realSuggestionDiff; } for (int i = 0; i < length; i++) { // Only spans that include the modified region make sense after replacement // Spans partially included in the replaced region are removed, there is no Loading