summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2019-11-20 08:39:43 +0900
committeraycabta <aycabta@gmail.com>2019-11-20 08:39:43 +0900
commit49b4507fd3caed356e4039da5820a7c843c6b05a (patch)
tree8067ff15f464c2026c3d82a9440ddb926acbddb6
parentbc0da8e3ff409f09888ffe98e6e66b503ebc8083 (diff)
Number sign comment (# bla bla) is a kind of newline character
-rw-r--r--lib/irb/ruby-lex.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/irb/ruby-lex.rb b/lib/irb/ruby-lex.rb
index 58a3e1e264..81024ea5bd 100644
--- a/lib/irb/ruby-lex.rb
+++ b/lib/irb/ruby-lex.rb
@@ -332,7 +332,7 @@ class RubyLex
depth_difference = 0
@tokens.each_with_index do |t, index|
case t[1]
- when :on_ignored_nl, :on_nl
+ when :on_ignored_nl, :on_nl, :on_comment
if index != (@tokens.size - 1)
depth_difference = 0
end
@@ -381,7 +381,7 @@ class RubyLex
@tokens.each_with_index do |t, index|
corresponding_token_depth = nil
case t[1]
- when :on_ignored_nl, :on_nl
+ when :on_ignored_nl, :on_nl, :on_comment
spaces_at_line_head = 0
is_first_spaces_of_line = true
is_first_printable_of_line = true