diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/irb.rb | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/irb.rb b/lib/irb.rb index 5ba0679501..caccb2bd30 100644 --- a/lib/irb.rb +++ b/lib/irb.rb @@ -670,10 +670,18 @@ module IRB when "l" ltype when "i" - if $1 - format("%" + $1 + "d", indent) + if indent < 0 + if $1 + "-".rjust($1.to_i) + else + "-" + end else - indent.to_s + if $1 + format("%" + $1 + "d", indent) + else + indent.to_s + end end when "n" if $1 |