1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/irb] Fix step's argument

cols.size was calling Integer#size, which returns 8.

Fixing a bug of https://github.com/ruby/irb/pull/209

c93ae4be71
This commit is contained in:
Takashi Kokubun 2021-03-20 23:48:10 -07:00 committed by git
parent d0b044a842
commit 75b38f1894

View file

@ -64,7 +64,7 @@ module IRB
def col_widths(strs, cols:)
cols.times.map do |col|
(col...strs.size).step(cols.size - 1).map do |i|
(col...strs.size).step(cols).map do |i|
strs[i].length
end.max
end