You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@justintsteele and I found this issues when 81+ length entries were in the array
Seen in version 2.1.0 but should be valid for the current latest 3.1.1 as well.
Issue Seen
When the passed array has entries over 80 chars with :columns_down.
irb(main):019:0> puts h.list(error_array, :columns_down)
/opt/orc-workstation/embedded/lib/ruby/gems/3.1.0/gems/highline-2.1.0/lib/highline/list.rb:162:in `each_slice': invalid slice size (ArgumentError)
from /opt/orc-workstation/embedded/lib/ruby/gems/3.1.0/gems/highline-2.1.0/lib/highline/list.rb:162:in `items_sliced_by_cols'
from /opt/orc-workstation/embedded/lib/ruby/gems/3.1.0/gems/highline-2.1.0/lib/highline/list.rb:98:in `slice_by_cols'
from /opt/orc-workstation/embedded/lib/ruby/gems/3.1.0/gems/highline-2.1.0/lib/highline/list.rb:155:in `build'
from /opt/orc-workstation/embedded/lib/ruby/gems/3.1.0/gems/highline-2.1.0/lib/highline/list.rb:66:in `initialize'
from /opt/orc-workstation/embedded/lib/ruby/gems/3.1.0/gems/highline-2.1.0/lib/highline/list_renderer.rb:125:in `new'
from /opt/orc-workstation/embedded/lib/ruby/gems/3.1.0/gems/highline-2.1.0/lib/highline/list_renderer.rb:125:in `list_columns_down_mode'
from /opt/orc-workstation/embedded/lib/ruby/gems/3.1.0/gems/highline-2.1.0/lib/highline/list_renderer.rb:80:in `render'
from /opt/orc-workstation/embedded/lib/ruby/gems/3.1.0/gems/highline-2.1.0/lib/highline.rb:359:in `list'
from (irb):19:in `<main>'
from /opt/orc-workstation/embedded/lib/ruby/gems/3.1.0/gems/irb-1.4.1/exe/irb:11:in `<top (required)>'
from /opt/orc-workstation/embedded/bin/irb:25:in `load'
from /opt/orc-workstation/embedded/bin/irb:25:in `<main>'
@justintsteele and I found this issues when 81+ length entries were in the array
Seen in version 2.1.0 but should be valid for the current latest 3.1.1 as well.
Issue Seen
When the passed array has entries over 80 chars with
:columns_down
.Comes down to the
col_count_calculate
method hereTo Produce
Example:
Can get around it with this:
But think the math should just default to 1 to prevent needing to override or pass in a bigger value than 80 here
The
col_count_calculate
method could just do this:Tested that in the installed gem and that works to prevent this, it will just go to 1 then:
The text was updated successfully, but these errors were encountered: