mirror of https://github.com/M66B/FairEmail.git
DeepL: trim after expand
This commit is contained in:
parent
40bd69398a
commit
99f6e716a5
|
@ -1999,10 +1999,17 @@ public class FragmentCompose extends FragmentBase {
|
|||
end = tmp;
|
||||
}
|
||||
|
||||
// Create paragraph
|
||||
// Expand selection at start
|
||||
while (start > 0 && edit.charAt(start - 1) != '\n')
|
||||
start--;
|
||||
|
||||
if (start == end && end < edit.length())
|
||||
end++;
|
||||
|
||||
// Expand selection at end
|
||||
while (end > 0 && end < edit.length() && edit.charAt(end - 1) != '\n')
|
||||
end++;
|
||||
|
||||
// Trim start
|
||||
while (start < edit.length() - 1 && edit.charAt(start) == '\n')
|
||||
start++;
|
||||
|
@ -2011,14 +2018,6 @@ public class FragmentCompose extends FragmentBase {
|
|||
while (end > 1 && edit.charAt(end - 2) == '\n')
|
||||
end--;
|
||||
|
||||
// Expand selection at start
|
||||
while (start > 0 && edit.charAt(start - 1) != '\n')
|
||||
start--;
|
||||
|
||||
// Expand selection at end
|
||||
while (end > 0 && end < edit.length() && edit.charAt(end - 1) != '\n')
|
||||
end++;
|
||||
|
||||
if (start < end)
|
||||
return new Pair(start, end);
|
||||
|
||||
|
|
Loading…
Reference in New Issue