More syntax highlighting fun

Doug Kearns dougkearns at gmail.com
Mon Feb 26 08:31:28 EST 2007


On Tue, Feb 27, 2007 at 12:09:12AM +1100, Doug Kearns wrote:

<snip>
 
> self isn't being highlighted in these two examples.
> 
> class <<self  
> end
> 
> class<<self  
> end

I've fixed this with the following.  Let me know if I'm overlooking
something.

Regards,
Doug


Index: syntax/ruby.vim
===================================================================
RCS file: /var/cvs/vim-ruby/vim-ruby/syntax/ruby.vim,v
retrieving revision 1.111
diff -u -b -r1.111 ruby.vim
--- syntax/ruby.vim	26 Feb 2007 09:51:06 -0000	1.111
+++ syntax/ruby.vim	26 Feb 2007 13:33:26 -0000
@@ -155,8 +155,8 @@
 syn match  rubyAliasDeclaration    "[^[:space:];#.()]\+"  contained contains=rubySymbol,rubyGlobalVariable,rubyPredefinedVariable nextgroup=rubyAliasDeclaration2 skipwhite
 syn match  rubyAliasDeclaration2   "[^[:space:];#.()]\+"  contained contains=rubySymbol,rubyGlobalVariable,rubyPredefinedVariable
 syn match  rubyMethodDeclaration   "[^[:space:];#(]\+" contained contains=rubyConstant,rubyBoolean,rubyPseudoVariable,rubyInstanceVariable,rubyClassVariable,rubyGlobalVariable
-syn match  rubyClassDeclaration    "[^[:space:];#(]\+" contained contains=rubyConstant
-syn match  rubyModuleDeclaration   "[^[:space:];#(]\+" contained contains=rubyConstant
+syn match  rubyClassDeclaration    "[^[:space:];#<]\+"	  contained contains=rubyConstant
+syn match  rubyModuleDeclaration   "[^[:space:];#]\+"	  contained contains=rubyConstant
 syn match  rubyFunction "\<[_[:alpha:]][_[:alnum:]]*[?!=]\=[[:alnum:].:?!=]\@!" contained containedin=rubyMethodDeclaration
 syn match  rubyFunction "\%(\s\|^\)\@<=[_[:alpha:]][_[:alnum:]]*[?!=]\=\%(\s\|$\)\@=" contained containedin=rubyAliasDeclaration,rubyAliasDeclaration2
 syn match  rubyFunction "\%([[:space:].]\|^\)\@<=\%(\[\]=\=\|\*\*\|[+-]@\=\|[*/%|&^~]\|<<\|>>\|[<>]=\=\|<=>\|===\|==\|=\~\|`\)\%([[:space:];#(]\|$\)\@=" contained containedin=rubyAliasDeclaration,rubyAliasDeclaration2,rubyMethodDeclaration


More information about the vim-ruby-devel mailing list