summaryrefslogtreecommitdiff
path: root/emitter.py
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2019-02-27 22:57:46 +0100
committerAnthon van der Neut <anthon@mnt.org>2019-02-27 22:57:46 +0100
commitc716679edf348ba59d7551600c9cf139e23961ef (patch)
tree853ee5edd3b44aa67e182bb36b983dbb4ecf8f45 /emitter.py
parent17af0e7a084955b5c0bf4124bba87190ac16734d (diff)
downloadruamel.yaml-c716679edf348ba59d7551600c9cf139e23961ef.tar.gz
fix issue #279 block sequence elements with flow mapping collapsed0.15.89
*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.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/emitter.py b/emitter.py
index 690cbc5..d4884bd 100644
--- a/emitter.py
+++ b/emitter.py
@@ -546,6 +546,8 @@ class Emitter(object):
if self.event.comment and self.event.comment[0]:
# eol comment on empty mapping
self.write_post_comment(self.event)
+ elif self.flow_level == 0:
+ self.write_line_break()
self.state = self.states.pop()
else:
if self.canonical or self.column > self.best_width:
@@ -574,6 +576,8 @@ class Emitter(object):
if self.event.comment and self.event.comment[0]:
# eol comment on flow mapping, never reached on empty mappings
self.write_post_comment(self.event)
+ else:
+ self.no_newline = False
self.state = self.states.pop()
else:
self.write_indicator(u',', False)