summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/irb.rb14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/irb.rb b/lib/irb.rb
index 5ba0679..caccb2b 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