muScript: append space if compact

This commit is contained in:
Johannes Frohnmeyer 2023-03-12 19:31:47 +01:00
parent 993f0bc6b7
commit 35130a9c7c
Signed by: Johannes
GPG Key ID: E76429612C2929F4
1 changed files with 3 additions and 2 deletions

View File

@ -15,7 +15,7 @@ public class ExprWriter implements Appendable, Closeable {
@Override
public ExprWriter append(CharSequence csq) throws IOException {
target.append(csq.toString().replace("\r", "").replace("\n", compact ? "" : "\n" + indent()));
target.append(csq.toString().replace("\r", "").replace("\n", compact ? " " : "\n" + indent()));
return this;
}
@ -29,7 +29,8 @@ public class ExprWriter implements Appendable, Closeable {
switch (c) {
case '\r' -> {}
case '\n' -> {
if (!compact) target.append("\n").append(indent());
if (compact) target.append(" ");
else target.append("\n").append(indent());
}
default -> target.append(c);
}