Skip to content

Commit

Permalink
Fix step's argument
Browse files Browse the repository at this point in the history
cols.size was calling Integer#size, which returns 8.

Fixing a bug of #209
  • Loading branch information
k0kubun committed Mar 21, 2021
1 parent fc3c5c5 commit c93ae4b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/irb/cmd/ls.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def fits_on_line?(strs, cols:, offset: 0)

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
Expand Down

0 comments on commit c93ae4b

Please sign in to comment.