Skip to content

Commit

Permalink
Show "-" if indent level is negative
Browse files Browse the repository at this point in the history
  • Loading branch information
aycabta committed Jul 1, 2019
1 parent 90c51ca commit 7685138
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions lib/irb.rb
Expand Up @@ -670,10 +670,18 @@ def prompt(prompt, ltype, indent, line_no) # :nodoc:
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
Expand Down

0 comments on commit 7685138

Please sign in to comment.