File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,4 +33,15 @@ def foo bar=:baz
3333 def foo bar:; end
3434 EOF
3535 end
36+
37+ specify "endless def does not start a method region" do
38+ assert_correct_highlighting <<~'EOF' , 'end' , ''
39+ def foo = bar
40+ end
41+ EOF
42+ assert_correct_highlighting <<~'EOF' , 'end' , ''
43+ def foo (a, b) = bar
44+ end
45+ EOF
46+ end
3647end
Original file line number Diff line number Diff line change @@ -363,6 +363,9 @@ if !exists("b:ruby_no_expensive") && !exists("ruby_no_expensive")
363363 SynFold ' class' syn region rubyClassBlock start = " \< class\> " matchgroup= rubyClass skip = " \< end:" end = " \< end\> " contains= ALLBUT ,@r ubyNotTop
364364 SynFold ' module' syn region rubyModuleBlock start = " \< module\> " matchgroup= rubyModule skip = " \< end:" end = " \< end\> " contains= ALLBUT ,@r ubyNotTop
365365
366+ " endless def
367+ syn match rubyDefine " \< def\s\+\z e[^[:space:];#(]\+\% (\s\+\|\s *(.*)\s *\) =" nextgroup =rubyMethodDeclaration skipwhite
368+
366369 " modifiers
367370 syn match rubyLineContinuation " \\ $" nextgroup =@rubyModifier skipwhite skipnl
368371 syn match rubyConditionalModifier " \<\% (if\| unless\)\> "
You can’t perform that action at this time.
0 commit comments