From 13d6885883022025c42cae8f95224ae3101d7dc1 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Mon, 7 May 2018 11:14:33 +0200 Subject: [PATCH] split heighlights by special characters. fixes #3007 --- .../java/eu/siacs/conversations/utils/StylingHelper.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/utils/StylingHelper.java b/src/main/java/eu/siacs/conversations/utils/StylingHelper.java index 69b88a4bf..c26a86ea4 100644 --- a/src/main/java/eu/siacs/conversations/utils/StylingHelper.java +++ b/src/main/java/eu/siacs/conversations/utils/StylingHelper.java @@ -45,7 +45,6 @@ import android.text.style.ForegroundColorSpan; import android.text.style.StrikethroughSpan; import android.text.style.StyleSpan; import android.text.style.TypefaceSpan; -import android.util.Log; import android.widget.EditText; import android.widget.TextView; @@ -53,7 +52,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import eu.siacs.conversations.Config; import eu.siacs.conversations.R; import eu.siacs.conversations.entities.Message; import eu.siacs.conversations.ui.text.QuoteSpan; @@ -112,6 +110,9 @@ public class StylingHelper { codepoint = term.codePointAt(i); if (Character.isLetterOrDigit(codepoint)) { builder.append(Character.toChars(codepoint)); + } else if (builder.length() > 0) { + words.add(builder.toString()); + builder.delete(0, builder.length()); } } if (builder.length() > 0) {