mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-08 10:03:51 +02:00
DeepL: trim after expand
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user