summaryrefslogtreecommitdiff
path: root/lib/irb/ruby-lex.rb
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2020-02-11 02:11:35 +0900
committeraycabta <aycabta@gmail.com>2020-02-12 13:14:28 +0900
commit8b8cc01229c2849236e7b43e1b5b5d33ccfb6b1e (patch)
tree83164baf13cf585fbe419e2ff5e0569c232fa33f /lib/irb/ruby-lex.rb
parent0719e1be11f4e3411b78f5e1d4de553f30f29bb0 (diff)
[ruby/irb] Fix auto indent with closed brace
A closed brace in auto-indent shouldn't affect the next brace in the same line, but it behaves like below: p() { } It's a bug. https://github.com/ruby/irb/commit/fbe59e344f
Diffstat (limited to 'lib/irb/ruby-lex.rb')
-rw-r--r--lib/irb/ruby-lex.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/irb/ruby-lex.rb b/lib/irb/ruby-lex.rb
index 3d1478d8ce..251db9efaa 100644
--- a/lib/irb/ruby-lex.rb
+++ b/lib/irb/ruby-lex.rb
@@ -394,6 +394,7 @@ class RubyLex
spaces_of_nest.pop
corresponding_token_depth = nil
end
+ open_brace_on_line -= 1
when :on_kw
next if index > 0 and @tokens[index - 1][3].allbits?(Ripper::EXPR_FNAME)
case t[2]