Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnevenColumnsAcross doesn't take color into account #21

Closed
yfeldblum opened this issue Nov 22, 2011 · 2 comments
Closed

UnevenColumnsAcross doesn't take color into account #21

yfeldblum opened this issue Nov 22, 2011 · 2 comments

Comments

@yfeldblum
Copy link

From #14:

This patch seems to work fine in the usual case.

ruby-1.9.2-p180 :007 > a = %w(Blah a b c ad e fs f g)
 => ["Blah", "a", "b", "c", "ad", "e", "fs", "f", "g"] 
ruby-1.9.2-p180 :008 > puts ui.list(a, :uneven_columns_across, 3)
Blah  a   b
c     ad  e
fs    f   g
 => nil 

However, when there's bold formatting on the first row, it doesn't seem to work right:

ruby-1.9.2-p180 :009 > a = [ui.color("Blah", :bold), ui.color("a", :bold), ui.color("b", :bold), "c", "ad", "e", "fs", "f", "g"]
 => ["\e[1mBlah\e[0m", "\e[1ma\e[0m", "\e[1mb\e[0m", "c", "ad", "e", "fs", "f", "g"] 
ruby-1.9.2-p180 :010 > puts ui.list(a, :uneven_columns_across, 3)
Blah  a  b
c             ad         e        
fs            f          g        
 => nil 

One specific use case for this issue is the knife-rackspace library. Example.

@JEG2
Copy link
Owner

JEG2 commented Nov 24, 2011

I believe the code I just pushed resolves this issue. Let me know if that's not the case.

@JEG2 JEG2 closed this as completed Nov 24, 2011
@yfeldblum
Copy link
Author

Worked for me.

Thank you sir!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants