Commit ab73d46e authored by Greg Ward's avatar Greg Ward

Fix SF bug #622849: in _wrap_chunks(), ensure that leading whitespace in

the input string is always preserved.
parent 2e74541d
......@@ -202,8 +202,9 @@ class TextWrapper:
# Maximum width for this line.
width = self.width - len(indent)
# First chunk on line is whitespace -- drop it.
if chunks[0].strip() == '':
# First chunk on line is whitespace -- drop it, unless this
# is the very beginning of the text (ie. no lines started yet).
if chunks[0].strip() == '' and lines:
del chunks[0]
while chunks:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment