summaryrefslogtreecommitdiff
path: root/lib/irb/ruby-lex.rb
diff options
context:
space:
mode:
authorNobuhiro IMAI <nov@yo.rim.or.jp>2020-03-24 15:24:01 +0900
committergit <svn-admin@ruby-lang.org>2021-02-03 00:09:32 +0900
commitb0fb2082187fe3cd247a92471aa42d3e6f779e51 (patch)
tree80fa55d60240797084b0ed47336cf4df92ad6247 /lib/irb/ruby-lex.rb
parent739f9297c562a387aa012bad781ac2f07f434c1e (diff)
downloadruby-b0fb2082187fe3cd247a92471aa42d3e6f779e51.tar.gz
[ruby/irb] follow up the actual line number
https://github.com/ruby/irb/commit/7aed8fe3b1
Diffstat (limited to 'lib/irb/ruby-lex.rb')
-rw-r--r--lib/irb/ruby-lex.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/irb/ruby-lex.rb b/lib/irb/ruby-lex.rb
index 938e9d42a6..ce94797dad 100644
--- a/lib/irb/ruby-lex.rb
+++ b/lib/irb/ruby-lex.rb
@@ -223,7 +223,10 @@ class RubyLex
throw :TERM_INPUT if @line == ''
else
@line_no += l.count("\n")
- next if l == "\n"
+ if l == "\n"
+ @exp_line_no += 1
+ next
+ end
@line.concat l
if @code_block_open or @ltype or @continue or @indent > 0
next