Handle case where maximum_width > screen_width

This commit is contained in:
Conrad Irwin 2012-11-29 09:53:01 -08:00
parent ccc2177f12
commit bd9804cb0e
1 changed files with 1 additions and 0 deletions

View File

@ -295,6 +295,7 @@ class Pry
things = things.compact
screen_width = TerminalInfo.screen_size[1]
maximum_width = things.map{|t| Pry::Helpers::Text.strip_color(t).length}.max + Pry.config.ls.separator.length
maximum_width = screen_width if maximum_width > screen_width
columns = screen_width / maximum_width
things.each_slice(columns).map do |slice|