Permalink
Browse files

Ensure `max_width` is always an Integer

Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
  • Loading branch information...
1 parent 79dcf24 commit f3a6242c35026a1a2af9ba20e0c8ac27f2e75eda @kyrylo kyrylo committed Jan 3, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/pry/code.rb
View
2 lib/pry/code.rb
@@ -393,7 +393,7 @@ def add_color(line_tuple)
def add_line_numbers(line_tuple)
max_width = @lines.last.last.to_s.length if @lines.length > 0
- padded_line_num = line_tuple[1].to_s.rjust(max_width)
+ padded_line_num = line_tuple[1].to_s.rjust(max_width || 0)
line_tuple[0] =
"#{ Pry::Helpers::BaseHelpers.colorize_code(padded_line_num.to_s) }: " \
"#{ line_tuple[0] }"

0 comments on commit f3a6242

Please sign in to comment.