From 76851381cb18a62f3a75720f868ac147e4c1c51c Mon Sep 17 00:00:00 2001 From: aycabta Date: Mon, 1 Jul 2019 21:14:50 +0900 Subject: Show "-" if indent level is negative --- lib/irb.rb | 14 +++++++++++--- 1 file 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 -- cgit v1.2.3