mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-26 17:57:16 +00:00
Added paragraph destroyer
This commit is contained in:
parent
71b919b40d
commit
7ebca45d28
1 changed files with 11 additions and 1 deletions
|
@ -500,7 +500,7 @@ public class FragmentCompose extends FragmentBase {
|
|||
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence text, int start, int count, int after) {
|
||||
if (count == 1 && after == 0 && text.charAt(start) == '\n') {
|
||||
if (count == 1 && after == 0 && (start == 0 || text.charAt(start) == '\n')) {
|
||||
Log.i("Removed=" + start);
|
||||
removed = start;
|
||||
}
|
||||
|
@ -607,7 +607,17 @@ public class FragmentCompose extends FragmentBase {
|
|||
}
|
||||
|
||||
if (removed != null) {
|
||||
ParagraphStyle[] ps = text.getSpans(removed, removed + 1, ParagraphStyle.class);
|
||||
if (ps != null)
|
||||
for (ParagraphStyle p : ps) {
|
||||
int start = text.getSpanStart(p);
|
||||
int end = text.getSpanEnd(p);
|
||||
if (start == removed && end == removed + 1)
|
||||
text.removeSpan(p);
|
||||
}
|
||||
|
||||
StyleHelper.renumber(text, true, etBody.getContext());
|
||||
|
||||
removed = null;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue