Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bf37a016 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Applications crash observed while selecting words from suggestion list"

parents 159f5340 299d62bd
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -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