compact sequence indentation option

This commit is contained in:
Natasha Sarkar
2021-06-22 18:13:31 -07:00
committed by Katrina Verey
parent 4cadad5cfe
commit 0ddf68cc8a
5 changed files with 50 additions and 7 deletions

View File

@@ -278,6 +278,11 @@ func (e *Encoder) SetIndent(spaces int) {
e.encoder.indent = spaces
}
// CompactSeqIndent makes it so that '- ' is considered part of the indentation.
func (e *Encoder) CompactSeqIndent() {
e.encoder.emitter.compact_sequence_indent = true
}
// Close closes the encoder by writing any remaining data.
// It does not write a stream terminating string "...".
func (e *Encoder) Close() (err error) {