Skip to content

Commit c7b3a70

Browse files
committed
Use space_before as documented in the generator
This option was already documented but not implemented, allows setting the separator used before the ":" during generation.
1 parent 0c096ac commit c7b3a70

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ext/json/ext/generator/generator.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,7 @@ static FBuffer *cState_prepare_buffer(VALUE self)
871871
} else {
872872
state->object_delim2 = fbuffer_alloc(16);
873873
}
874+
if (state->space_before) fbuffer_append(state->object_delim2, state->space_before, state->space_before_len);
874875
fbuffer_append_char(state->object_delim2, ':');
875876
if (state->space) fbuffer_append(state->object_delim2, state->space, state->space_len);
876877

0 commit comments

Comments
 (0)