From 5b494e5ca0895e2e7e06a454081a6e1ed8857f63 Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 14 Sep 2020 18:22:54 +0200 Subject: [PATCH] Improved insert template workaround --- app/src/main/java/eu/faircode/email/FragmentCompose.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index 78606dbe87..61aa0b5a05 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -1636,8 +1636,11 @@ public class FragmentCompose extends FragmentBase { }, null, getContext()); int start = etBody.getSelectionStart(); - if (start < 0) - start = 0; + if (start < 0) { + start = etBody.length() - 1; + if (start < 0) + start = 0; + } etBody.getText().insert(start, spanned);