Skip to content

Commit

Permalink
FIX: MOLD/FLAT on object values does not remove line breaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Oldes committed Feb 1, 2019
1 parent 9e2846c commit eb7ba29
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/core/s-mold.c
Original file line number Diff line number Diff line change
Expand Up @@ -900,6 +900,7 @@ STOID Mold_Object(REBVAL *value, REB_MOLD *mold)
REBVAL *words;
REBVAL *vals; // first value is context
REBCNT n;
REBOOL indented = !GET_MOPT(mold, MOPT_INDENT);

ASSERT(VAL_OBJ_FRAME(value), RP_NO_OBJECT_FRAME);

Expand Down Expand Up @@ -927,7 +928,11 @@ STOID Mold_Object(REBVAL *value, REB_MOLD *mold)
!VAL_GET_OPT(words+n, OPTS_HIDE) &&
((VAL_TYPE(vals+n) > REB_NONE) || !GET_MOPT(mold, MOPT_NO_NONE))
){
New_Indented_Line(mold);
if(indented)
New_Indented_Line(mold);
else if (n > 1)
Append_Byte(mold->series, ' ');

Append_UTF8(mold->series, Get_Sym_Name(VAL_WORD_SYM(words+n)), -1);
//Print("Slot: %s", Get_Sym_Name(VAL_WORD_SYM(words+n)));
Append_Bytes(mold->series, ": ");
Expand All @@ -936,7 +941,7 @@ STOID Mold_Object(REBVAL *value, REB_MOLD *mold)
}
}
mold->indent--;
New_Indented_Line(mold);
if (indented) New_Indented_Line(mold);
Append_Byte(mold->series, ']');

End_Mold(mold);
Expand Down

0 comments on commit eb7ba29

Please sign in to comment.