Permalink
Browse files

Using the ANSI module to print menu items

  • Loading branch information...
Mon-Ouie committed Oct 11, 2012
1 parent bd150a9 commit 538fa9c00022e17748d174d66c0da8ee768c72c3
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/coolline/menu.rb
View
@@ -27,7 +27,7 @@ def list=(items)
else
height, width = @input.winsize
col_width = items.max_by(&:size).size + 1
col_width = items.map { |s| ansi_length(s) }.max
col_count = width / col_width
item_count = col_count * (height - 1)
@@ -51,7 +51,7 @@ def display
lines[0, height - 1].each do |line|
print "\n\r"
print line[0, width].chomp
ansi_print(line.chomp, 0, width)
end
reset_color

0 comments on commit 538fa9c

Please sign in to comment.