@@ -344,6 +344,7 @@ def spot_call_for_name
344344 end
345345 elsif mid . to_s =~ /\A \W +\z / && lines . match ( /\G \s *(#{ Regexp . quote ( mid ) } )=.*\n / , nd_recv . last_column )
346346 @snippet = $` + $&
347+ @beg_lineno = @end_lineno = lineno
347348 @beg_column = $~. begin ( 1 )
348349 @end_column = $~. end ( 1 )
349350 end
@@ -582,8 +583,9 @@ def spot_colon2
582583 @beg_column = nd_parent . last_column
583584 @end_column = @node . last_column
584585 else
585- @snippet = @fetch [ @ node. last_lineno ]
586+ fetch_line ( @ node. last_lineno )
586587 if @snippet [ ...@node . last_column ] . match ( /#{ Regexp . quote ( const ) } \z / )
588+ @beg_lineno = @end_lineno = @node . last_lineno
587589 @beg_column = $~. begin ( 0 )
588590 @end_column = $~. end ( 0 )
589591 end
@@ -597,7 +599,7 @@ def spot_op_cdecl
597599 nd_lhs , op , _nd_rhs = @node . children
598600 *nd_parent_lhs , _const = nd_lhs . children
599601 if @name == op
600- @snippet = @fetch [ nd_lhs . last_lineno ]
602+ fetch_line ( nd_lhs . last_lineno )
601603 if @snippet . match ( /\G \s *(#{ Regexp . quote ( op ) } )=/ , nd_lhs . last_column )
602604 @beg_column = $~. begin ( 1 )
603605 @end_column = $~. end ( 1 )
@@ -607,12 +609,12 @@ def spot_op_cdecl
607609 @end_column = nd_lhs . last_column
608610 if nd_parent_lhs . empty? # example: ::C += 1
609611 if nd_lhs . first_lineno == nd_lhs . last_lineno
610- @snippet = @fetch [ nd_lhs . last_lineno ]
612+ fetch_line ( nd_lhs . last_lineno )
611613 @beg_column = nd_lhs . first_column
612614 end
613615 else # example: Foo::Bar::C += 1
614616 if nd_parent_lhs . last . last_lineno == nd_lhs . last_lineno
615- @snippet = @fetch [ nd_lhs . last_lineno ]
617+ fetch_line ( nd_lhs . last_lineno )
616618 @beg_column = nd_parent_lhs . last . last_column
617619 end
618620 end
0 commit comments