pull/213/head
M66B 1 year ago
parent 171aa6a370
commit d71be68c77

@ -739,11 +739,12 @@ public class FragmentCompose extends FragmentBase {
if (save != null) if (save != null)
try { try {
if (lt == null && lt_sentence) { if (lt == null && lt_sentence &&
Helper.isSentenceChar(text.charAt(save))) {
int start = save; int start = save;
while (start > 0 && while (start > 0 &&
text.charAt(start - 1) != '\n' && text.charAt(start - 1) != '\n' &&
!Helper.isEndChar(text.charAt(start - 1))) !Helper.isSentenceChar(text.charAt(start - 1)))
start--; start--;
while (start < save) while (start < save)
if (Character.isWhitespace(text.charAt(start))) if (Character.isWhitespace(text.charAt(start)))

@ -2528,10 +2528,13 @@ public class Helper {
} }
static boolean isEndChar(char c) { static boolean isEndChar(char c) {
return (isSentenceChar(c) ||
c == ',' || c == ':' || c == ';');
}
static boolean isSentenceChar(char c) {
return (c == '.' /* Latin */ || return (c == '.' /* Latin */ ||
c == '。' /* Chinese */ || c == '。' /* Chinese */ ||
c == ',' ||
c == ':' || c == ';' ||
c == '?' || c == '!'); c == '?' || c == '!');
} }

Loading…
Cancel
Save