summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2021-03-20 23:48:10 -0700
committergit <svn-admin@ruby-lang.org>2021-03-21 15:50:53 +0900
commit75b38f18940764f048ded4a3938407566152cbee (patch)
tree192f0bdcf796b0c4826f52068beb69a6630213c0 /lib
parentd0b044a842ec03525ab839eb79864899ad81bed3 (diff)
[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 https://github.com/ruby/irb/commit/c93ae4be71
Diffstat (limited to 'lib')
-rw-r--r--lib/irb/cmd/ls.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/irb/cmd/ls.rb b/lib/irb/cmd/ls.rb
index 07e6fbc487..87798a22d7 100644
--- a/lib/irb/cmd/ls.rb
+++ b/lib/irb/cmd/ls.rb
@@ -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