--- libyaml/src/api.c 2022-02-09 13:06:31.373103740 -0600 +++ yaml/src/api.c 2022-02-09 13:28:42.162132786 -0600 @@ -541,6 +541,18 @@ } /* + * Set whether or not to indent block sequences in mapping context. + */ + +YAML_DECLARE(void) +yaml_emitter_set_indent_mapping_sequence(yaml_emitter_t *emitter, int indent_mapping_sequence) +{ + assert(emitter); /* Non-NULL emitter object expected. */ + + emitter->indent_mapping_sequence = indent_mapping_sequence; +} + +/* * Set the preferred line width. */ --- libyaml/src/emitter.c 2022-02-09 13:06:31.374103725 -0600 +++ yaml/src/emitter.c 2022-02-09 13:28:45.995087663 -0600 @@ -886,7 +886,9 @@ if (first) { if (!yaml_emitter_increase_indent(emitter, 0, - (emitter->mapping_context && !emitter->indention))) + (emitter->mapping_context + && !emitter->indent_mapping_sequence + && !emitter->indention))) return 0; } @@ -1825,6 +1827,7 @@ emitter->whitespace = is_whitespace; emitter->indention = (emitter->indention && is_indention); + emitter->open_ended = 0; return 1; } @@ -1977,6 +1980,10 @@ emitter->whitespace = 0; emitter->indention = 0; + if (emitter->root_context) + { + emitter->open_ended = 1; + } return 1; }