Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
dr0i committed Jul 11, 2024
1 parent e3cf044 commit c7ea572
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ private static class Encoder extends DefaultStreamPipe<ObjectReceiver<String>> {
private int indentationLevel;
private boolean formatted = PRETTY_PRINTED;
private int recordAttributeOffset;
private int recordLeaderOffset;

private Encoder() {
}
Expand Down Expand Up @@ -294,7 +295,7 @@ public void startRecord(final String identifier) {
writeTag(Tag.record::open);
recordAttributeOffset = builder.length() - 1;
prettyPrintNewLine();

recordLeaderOffset = builder.length() - 1;
incrementIndentationLevel();
}

Expand Down Expand Up @@ -353,7 +354,7 @@ else if (!appendLeader(name, value)) {
if (value != null) {
writeEscaped(value.trim());
}
writeTag(Tag.controlfield::close);
writeTag(Tag.controlfield::close, false);
prettyPrintNewLine();
}
}
Expand Down Expand Up @@ -408,6 +409,7 @@ private void writeFooter() {
* @param str the unescaped sequence to be written
*/
private void writeRaw(final String str) {

builder.append(str);
}

Expand All @@ -434,7 +436,7 @@ private void writeLeader() {
final String leader = leaderBuilder.toString();
if (!leader.isEmpty()) {
prettyPrintIndentation();
writeTag(Tag.leader::open);
writeTag(Tag.leader::open, false);
writeRaw(leader);
writeTag(Tag.leader::close);
prettyPrintNewLine();
Expand Down

0 comments on commit c7ea572

Please sign in to comment.