add: scroll to game crash report automatically

This commit is contained in:
huanghongxun
2020-04-06 13:21:17 +08:00
parent d00b269786
commit 8df651c5a8
4 changed files with 67 additions and 35 deletions

View File

@@ -217,4 +217,22 @@ public final class StringUtils {
public static String parseColorEscapes(String original) {
return original.replaceAll("\u00A7\\d", "");
}
public static String parseEscapeSequence(String str) {
StringBuilder builder = new StringBuilder();
boolean inEscape = false;
for (int i = 0; i < str.length(); i++) {
char ch = str.charAt(i);
if (ch == '\033') {
inEscape = true;
}
if (!inEscape) {
builder.append(ch);
}
if (inEscape && ch == 'm') {
inEscape = false;
}
}
return builder.toString();
}
}