muScript: append space if compact
This commit is contained in:
parent
993f0bc6b7
commit
35130a9c7c
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue