From fd8fc2f17825c09267672bab594e4b69856b4be2 Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 11 Aug 2020 22:12:00 +0200 Subject: [PATCH] Check bullet paragraph --- app/src/main/java/eu/faircode/email/StyleHelper.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/StyleHelper.java b/app/src/main/java/eu/faircode/email/StyleHelper.java index 755ddd1a88..8dd68259df 100644 --- a/app/src/main/java/eu/faircode/email/StyleHelper.java +++ b/app/src/main/java/eu/faircode/email/StyleHelper.java @@ -200,7 +200,7 @@ public class StyleHelper { int i = s; int j = s + 1; while (j < e) { - if (t.charAt(j) == '\n') { + if (i > 0 && t.charAt(i - 1) == '\n' && t.charAt(j) == '\n') { t.setSpan(new BulletSpan(), i, j + 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE | Spanned.SPAN_PARAGRAPH); i = j + 1; } @@ -208,7 +208,6 @@ public class StyleHelper { } etBody.setText(t); - etBody.setSelection(s, e); return true; }