mirror of
https://github.com/evennia/evennia.git
synced 2026-03-24 00:36:30 +01:00
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:
parent
83f67ac2c4
commit
ecb7d6fcc5
1 changed files with 2 additions and 3 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue