1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Decrease indent when "else", "rescue", "ensure", "when", or "in" come

This commit is contained in:
aycabta 2019-06-25 22:00:29 +09:00
parent 1cbc4f9876
commit 0b57f9b25d

View file

@ -350,6 +350,8 @@ class RubyLex
unless t[3].allbits?(Ripper::EXPR_LABEL)
spaces_of_nest.push(spaces_at_line_head)
end
when 'else', 'rescue', 'ensure', 'when', 'in'
corresponding_token_depth = spaces_of_nest.last
when 'end'
if is_first_printable_of_line
corresponding_token_depth = spaces_of_nest.pop