mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 15:27:13 +03:00
util: wrap at termwidth-2 by default
This commit is contained in:
parent
a2bda0adf6
commit
607267cbbc
@ -1272,7 +1272,9 @@ def termwidth():
|
||||
pass
|
||||
return 80
|
||||
|
||||
def wrap(line, hangindent, width=78):
|
||||
def wrap(line, hangindent, width=None):
|
||||
if width is None:
|
||||
width = termwidth() - 2
|
||||
padding = '\n' + ' ' * hangindent
|
||||
return padding.join(textwrap.wrap(line, width=width - hangindent))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user