diff --git a/app/src/main/java/org/solovyev/android/calculator/view/TextHighlighter.java b/app/src/main/java/org/solovyev/android/calculator/view/TextHighlighter.java index dbf3a4fd..5e6f4d55 100644 --- a/app/src/main/java/org/solovyev/android/calculator/view/TextHighlighter.java +++ b/app/src/main/java/org/solovyev/android/calculator/view/TextHighlighter.java @@ -23,20 +23,27 @@ package org.solovyev.android.calculator.view; import android.graphics.Typeface; +import android.support.annotation.NonNull; import android.text.SpannableStringBuilder; import android.text.style.ForegroundColorSpan; import android.text.style.StyleSpan; + import com.google.common.collect.Lists; + import org.solovyev.android.Check; -import org.solovyev.android.calculator.*; +import org.solovyev.android.calculator.BaseNumberBuilder; +import org.solovyev.android.calculator.Engine; +import org.solovyev.android.calculator.LiteNumberBuilder; +import org.solovyev.android.calculator.NumberBuilder; import org.solovyev.android.calculator.math.MathType; import org.solovyev.android.calculator.text.TextProcessor; import org.solovyev.android.calculator.text.TextProcessorEditorResult; -import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.List; +import javax.annotation.Nonnull; + public class TextHighlighter implements TextProcessor { private final int red; @@ -149,15 +156,24 @@ public class TextHighlighter implements TextProcessor= end) { + return; + } + t.setSpan(span, start, end, SpannableStringBuilder.SPAN_EXCLUSIVE_EXCLUSIVE); } private int fillGroupSpans(@Nonnull SpannableStringBuilder sb, int start, int group, int groupsCount, @Nonnull List spans) {