summaryrefslogtreecommitdiff
path: root/emitter.py
diff options
context:
space:
mode:
Diffstat (limited to 'emitter.py')
-rw-r--r--emitter.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/emitter.py b/emitter.py
index 08b6bb0..d3576e0 100644
--- a/emitter.py
+++ b/emitter.py
@@ -1618,6 +1618,9 @@ class Emitter:
else:
if ch is None or ch in ' \n\x85\u2028\u2029':
data = text[start:end]
+ if len(data) > self.best_width and self.column > self.indent:
+ # words longer than line length get a line of their own
+ self.write_indent()
self.column += len(data)
if self.encoding:
data = data.encode(self.encoding) # type: ignore