Change utils.wrap() to indent on all lines, not only the lines following the first. If someone remembers why this default was set, do report it.

This commit is contained in:
Griatch 2016-08-25 18:36:21 +02:00
parent 83f67ac2c4
commit ecb7d6fcc5

View file

@ -85,8 +85,7 @@ def wrap(text, width=_DEFAULT_WIDTH, indent=0):
Args:
text (str): The text to wrap.
width (int, optional): The number of characters to wrap to.
indent (int): How much to indent new lines (the first line
will not be indented)
indent (int): How much to indent each line (with whitespace).
Returns:
text (str): Properly wrapped text.
@ -96,7 +95,7 @@ def wrap(text, width=_DEFAULT_WIDTH, indent=0):
return ""
text = to_unicode(text)
indent = " " * indent
return to_str(textwrap.fill(text, width, subsequent_indent=indent))
return to_str(textwrap.fill(text, width, initial_indent=indent, subsequent_indent=indent))
# alias - fill
fill = wrap