From 32eb7c96f4480c25d9e678eb173cad13e1e6b39b Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 23 May 2024 14:06:47 +0200 Subject: [PATCH] Debug: inserted spans --- app/src/main/java/eu/faircode/email/StyleHelper.java | 5 +++-- 1 file changed, 3 insertions(+), 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 4bf87ca331..576c0c7f2e 100644 --- a/app/src/main/java/eu/faircode/email/StyleHelper.java +++ b/app/src/main/java/eu/faircode/email/StyleHelper.java @@ -318,8 +318,7 @@ public class StyleHelper { if (renum) StyleHelper.renumber(text, false, etBody.getContext()); - if (BuildConfig.DEBUG) - StyleHelper.markAsInserted(text, -1, -1); + StyleHelper.markAsInserted(text, -1, -1); } catch (Throwable ex) { Log.e(ex); } finally { @@ -1767,6 +1766,8 @@ public class StyleHelper { } static void markAsInserted(Editable text, int start, int end) { + if (!BuildConfig.DEBUG) + return; for (InsertedSpan span : text.getSpans(0, text.length(), InsertedSpan.class)) text.removeSpan(span); if (start >= 0 && start < end && end <= text.length()) {