diff options
author | Anthon van der Neut <anthon@mnt.org> | 2018-09-26 22:13:40 +0200 |
---|---|---|
committer | Anthon van der Neut <anthon@mnt.org> | 2018-09-26 22:13:40 +0200 |
commit | 07e7eb667bbd75b4c127f4f418e8e35c72fb12fe (patch) | |
tree | d8cdfa17db0c432a675aa4d3e93be3e86a0712af /emitter.py | |
parent | 4f2694580a82e11b5ae13aa3cb1c177af5bb8827 (diff) | |
download | ruamel.yaml-07e7eb667bbd75b4c127f4f418e8e35c72fb12fe.tar.gz |
fix issue #241 incorrect emit of literal scalars with indent indication
test in yaml.data/literal_non_root_indent_indicator.yaml
*When this change indeed resolves your problem, please **Close** this issue*.
*(You can do so using the WorkFlow pull-down (close to the top right of this page))*
Diffstat (limited to 'emitter.py')
-rw-r--r-- | emitter.py | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -1486,9 +1486,10 @@ class Emitter(object): else: self.write_line_break(br) if ch is not None: - if _indent: - self.stream.write(u' ' * _indent) - elif not self.root_context or self.requested_indent: + if self.root_context: + idnx = self.indent if self.indent is not None else 0 + self.stream.write(u' ' * (_indent + idnx)) + else: self.write_indent() start = end else: |