summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2019-06-25 22:00:29 +0900
committeraycabta <aycabta@gmail.com>2019-06-25 22:02:31 +0900
commit0b57f9b25d43c2efec8ac17c0c03ce9fa461937a (patch)
tree5d01bdc21debaf142016b5219101c49baaadd2fa /lib
parent1cbc4f987656ac8d8ede6c7cd178ac8e6c2a909b (diff)
Decrease indent when "else", "rescue", "ensure", "when", or "in" come
Diffstat (limited to 'lib')
-rw-r--r--lib/irb/ruby-lex.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/irb/ruby-lex.rb b/lib/irb/ruby-lex.rb
index 906f2bd117..cb1538044e 100644
--- a/lib/irb/ruby-lex.rb
+++ b/lib/irb/ruby-lex.rb
@@ -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