Skip to content
Myr

Don't accomodate for small terminals

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parent b8ca3f5 · Browse files · 2 files+6 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+6 added−2 removed

  • other:+6 added−2 removed

2 files+6 added−2 removed

modified:click/formatting.py+2 added-2 removed
95 unmodified lines
9697 def __init__(self, indent_increment=2, width=None):98 self.indent_increment = indent_increment99 if width is None:100 width = min(get_terminal_size()[0], 80) - 2100 width = max(min(get_terminal_size()[0], 80) - 2, 50)101 self.width = width102 self.current_indent = 0103 self.buffer = []104
74 unmodified lines
179 else:180 self.write('\n')181 self.write(' ' * (first_col + self.current_indent))182183 text_width = self.width - first_col - 2183 text_width = max(self.width - first_col - 2, 10)184 lines = iter(wrap_text(second, text_width).splitlines())185 if lines:186 self.write(next(lines) + '\n')187 for line in lines:
52 unmodified lines
modified:CHANGES+4 added
6 unmodified lines
7-----------89(codename and release date to be decided)1011- formatter now no longer attempts to accomodate for terminals12 smaller than 50 characters. If that happens it just assumes13 a minimal width.1415Version 2.116-----------1718(bugfix release, released on June 14th 2014)
68 unmodified lines