优化 LogWindow (#3274)

* update

* update

* update

* update

* update
This commit is contained in:
Glavo
2024-09-02 20:54:33 +08:00
committed by GitHub
parent 6409841cca
commit 8a816f7f35
12 changed files with 333 additions and 248 deletions

View File

@@ -346,9 +346,15 @@ public final class StringUtils {
}
public static String parseEscapeSequence(String str) {
StringBuilder builder = new StringBuilder();
int idx = str.indexOf('\033');
if (idx < 0)
return str;
StringBuilder builder = new StringBuilder(str.length());
boolean inEscape = false;
for (int i = 0; i < str.length(); i++) {
builder.append(str, 0, idx);
for (int i = idx; i < str.length(); i++) {
char ch = str.charAt(i);
if (ch == '\033') {
inEscape = true;