rubyFunction, rubyClass, and rubyModule no longer highlighted

Tim Pope vim-ruby-devel at
Sun Feb 18 17:58:41 EST 2007

In the latest CVS version of syntax/ruby.vim, method, class, and
module declarations are no longer highlighted.  This seems to be due
to changing lines like

syn region rubyFunction matchgroup=rubyDefine start="\<def\s\+"    end="\%(\s*\%(\s\|(\|;\|$\|#\)\)\@=" oneline

to lines like

syn region rubyFunction matchgroup=rubyDefine start="\<def\(\s\+\)\@="    end="\%(\s*\%(\s\|(\|;\|$\|#\)\)\@=" oneline

Presumably, this was to allow def, etc to be highlighted before the
following space is input.  A much simpler pattern (and one that
actually works) is

syn region  rubyFunction matchgroup=rubyControl start="\<def\>\s*"    end="\ze\%(\s\|(\|;\|$\)" oneline

I will update the syntax file to use this third form if nobody objects.
I also have a few other minor changes that make the colors easier to
tweak (things like grouping regexps together as rubyRegexp).



More information about the vim-ruby-devel mailing list