Skip to content
Myr

Fixed text wrapping on 3.x. This fixes #196

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 73ef9f3 · Browse files · 2 files+3 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+3 added−2 removed

  • other:+3 added−2 removed

2 files+3 added−2 removed

modified:click/_textwrap.py+2 added-2 removed
1import textwrap2from contextlib import contextmanager3from ._compat import term_len3from ._compat import term_len, range_type456class TextWrapper(textwrap.TextWrapper):78 def _cutdown(self, ucstr, space_left):9 l = 010 for i in xrange(len(ucstr)):10 for i in range_type(len(ucstr)):11 l += term_len(ucstr[i])12 if space_left < l:13 return (ucstr[:i], ucstr[i:])14 return ucstr, ''
31 unmodified lines
modified:CHANGES+1 added
7 unmodified lines
89(bugfix release, released on July 4th 2014)1011- Corrected a bug in the change of the help option in 2.3.12- Fixed a bug with text wrapping on Python 3.1314Version 2.315-----------16
89 unmodified lines