Skip to content

Commit

Permalink
[ruby/irb] Determine left and right when the width of either side is …
Browse files Browse the repository at this point in the history
…zero correctly

ruby/irb@5df6e1f027
  • Loading branch information
aycabta authored and matzbot committed Oct 8, 2021
1 parent 576eccf commit 1507cb0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/irb/input-method.rb
Expand Up @@ -381,10 +381,10 @@ def auto_indent(&block)
width = left_width
x = left_x
end
elsif right_width.positive? and left_width.negative?
elsif right_width.positive? and left_width <= 0
width = right_width
x = right_x
elsif right_width.negative? and left_width.positive?
elsif right_width <= 0 and left_width.positive?
width = left_width
x = left_x
else # Both are negative width.
Expand Down

0 comments on commit 1507cb0

Please sign in to comment.