Closed toolmantim closed 9 years ago
Thanks, good catch! I think we could actually set the threshold much higher; it doesn't make much sense to wrap at 1 character when the width is 6, for instance. What do you think about turning wrapping off below 40?
Makes sense to me! I'll update it to be >= 40?
Sounds good!
Cool, updated to 40. I also discovered we should be using Highline#output_cols
, which already does the rescue
and what-not for the terminal size calculation. Tested and pushed.
:heart::tada:
Thank you! Just cut a new version, 4.3.5, to include this patch. :zap:
Boom! And that worked a treat. Thanks for the :zap:'y release!
If a terminal reports it's screen width as < 5, wrap_at could become negative causing Highline to enter an infinite loop whilst wrapping.
This makes sure we don't set negative wrap_at values by ensuring the terminal screen width at least 5.
It also cleans up the duplicated code.