diff options
author | aycabta <[email protected]> | 2019-07-01 21:14:50 +0900 |
---|---|---|
committer | aycabta <[email protected]> | 2019-07-01 21:14:50 +0900 |
commit | 76851381cb18a62f3a75720f868ac147e4c1c51c (patch) | |
tree | 15bac22a15a6e75a0f174e84e00c7a67ad2a9b40 /lib/irb.rb | |
parent | 90c51ca39170030b2ea0611bcbb435b76915a287 (diff) |
Show "-" if indent level is negative
Diffstat (limited to 'lib/irb.rb')
-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 |