diff options
author | Anthon van der Neut <anthon@mnt.org> | 2016-02-27 14:53:44 +0100 |
---|---|---|
committer | Anthon van der Neut <anthon@mnt.org> | 2016-02-27 14:53:44 +0100 |
commit | 638b3d07b210f8636507c1530e925445f9c3aba9 (patch) | |
tree | d0c35dd79eae8ed610a9e33df8c3ea8b4e76a767 /emitter.py | |
parent | 0fbfd2d3f7895ebae49dc85abbe8844abb0e19bf (diff) | |
download | ruamel.yaml-638b3d07b210f8636507c1530e925445f9c3aba9.tar.gz |
implement indent for scalar list elements
Diffstat (limited to 'emitter.py')
-rw-r--r-- | emitter.py | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -257,7 +257,7 @@ class Emitter(object): def expect_node(self, root=False, sequence=False, mapping=False, simple_key=False): self.root_context = root - self.sequence_context = sequence + self.sequence_context = sequence # not used in PyYAML self.mapping_context = mapping self.simple_key_context = simple_key if isinstance(self.event, AliasEvent): @@ -583,6 +583,8 @@ class Emitter(object): # if self.analysis.multiline and split \ # and (not self.style or self.style in '\'\"'): # self.write_indent() + if self.sequence_context and not self.flow_level: + self.write_indent() if self.style == '"': self.write_double_quoted(self.analysis.scalar, split) elif self.style == '\'': @@ -1204,7 +1206,6 @@ class Emitter(object): def write_comment(self, comment): value = comment.value - print('################## comment', repr(value)) # print('{:02d} {:02d} {}'.format(self.column, comment.start_mark.column, value)) if value[-1] == '\n': value = value[:-1] |