diff --git a/src/main/java/dev/nolij/zson/Zson.java b/src/main/java/dev/nolij/zson/Zson.java index fc1e9c6..71b3f2a 100644 --- a/src/main/java/dev/nolij/zson/Zson.java +++ b/src/main/java/dev/nolij/zson/Zson.java @@ -1089,14 +1089,15 @@ private String value(Object value) { return String.valueOf(value); } else if (value instanceof Iterable iterableValue) { StringBuilder output = new StringBuilder("["); - output.append(expandArrays ? "\n" : " "); + String indent = expandArrays ? this.indent : ""; + output.append(indent); boolean first = true; for (Object obj : iterableValue) { if (!first) { output.append(",") - .append(expandArrays ? "\n" : " "); + .append(indent); } else { first = false; } @@ -1108,7 +1109,7 @@ private String value(Object value) { output.append(value(obj).replace("\n", "\n" + indent + indent)); } - output.append(expandArrays ? "\n" : " "); + output.append(indent); if (expandArrays) output.append(indent);