Skip to content

Commit c93ae4b

Browse files
committed
Fix step's argument
cols.size was calling Integer#size, which returns 8. Fixing a bug of #209
1 parent fc3c5c5 commit c93ae4b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/irb/cmd/ls.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def fits_on_line?(strs, cols:, offset: 0)
6464

6565
def col_widths(strs, cols:)
6666
cols.times.map do |col|
67-
(col...strs.size).step(cols.size - 1).map do |i|
67+
(col...strs.size).step(cols).map do |i|
6868
strs[i].length
6969
end.max
7070
end

0 commit comments

Comments
 (0)