Skip to content

Commit

Permalink
Add option to smart_width to indent first line or not
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Aug 27, 2018
1 parent b985be8 commit e625afb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/shellman/templates/filters.py
Expand Up @@ -74,7 +74,7 @@ def console_width(default=80):
return shutil.get_terminal_size((default, 20)).columns


def smart_width(text, indent=4, width=None):
def smart_width(text, indent=4, width=None, first_line=True):
if width is None or width < 0:
c_width = console_width(default=79)
if width is None:
Expand Down Expand Up @@ -108,7 +108,7 @@ def smart_width(text, indent=4, width=None):
textwrap.fill(
line,
width,
initial_indent=indent_str,
initial_indent=indent_str if first_line else '',
subsequent_indent=indent_str
)
)
Expand Down

0 comments on commit e625afb

Please sign in to comment.