Small behavior improvement

This commit is contained in:
M66B 2022-10-03 15:48:47 +02:00
parent 06b34e0597
commit f500acb5fe
1 changed files with 4 additions and 0 deletions

View File

@ -2407,6 +2407,10 @@ public class FragmentCompose extends FragmentBase {
if (languages == null) if (languages == null)
languages = new ArrayList<>(); languages = new ArrayList<>();
int s = etBody.getSelectionStart();
if (s > 0 && s == etBody.length() && etBody.getText().charAt(s - 1) == '\n')
etBody.setSelection(s - 1, s - 1);
Pair<Integer, Integer> paragraph = StyleHelper.getParagraph(etBody); Pair<Integer, Integer> paragraph = StyleHelper.getParagraph(etBody);
boolean canTranslate = (DeepL.canTranslate(context) && paragraph != null); boolean canTranslate = (DeepL.canTranslate(context) && paragraph != null);