regex problem

Doug Kearns djkea2 at mugca.its.monash.edu.au
Thu Sep 30 10:45:55 EDT 2004


On Thu, Sep 30, 2004 at 12:10:14AM +1000, Gavin Sinclair wrote:
> 
> ===8<==============Original message text===============
> Hi Gavin,
> 
> I just notices a small bug in the syntax highlighting for Ruby - it does 
> not highlight a regexp literal if it is after the '=>' symbol in a Hash 
> literal.
> 
> Tony.
> ===8<===========End of original message text===========

A quick fix...

Regards,
Doug

Index: syntax/ruby.vim
===================================================================
RCS file: /var/cvs/vim-ruby/vim-ruby/syntax/ruby.vim,v
retrieving revision 1.37
diff -u -r1.37 ruby.vim
--- syntax/ruby.vim	12 May 2004 13:35:07 -0000	1.37
+++ syntax/ruby.vim	30 Sep 2004 14:39:49 -0000
@@ -77,7 +77,7 @@
 
 " Normal Regular Expression
 syn region rubyString matchgroup=rubyStringDelimiter start="^\s*/" start="\<and\s*/"lc=3 start="\<or\s*/"lc=2 start="\<while\s*/"lc=5 start="\<until\s*/"lc=5 start="\<unless\s*/"lc=6 start="\<if\s*/"lc=2 start="\<elsif\s*/"lc=5 start="\<when\s*/"lc=4 start="\<not\s*/"lc=3  start="\<then\s*/"lc=4 start="[\~=!|&(,[]\s*/"lc=1 end="/[iomx]*" skip="\\\\\|\\/" contains=@rubyStringSpecial
-syn region rubyString matchgroup=rubyStringDelimiter start="\<split\s*/"lc=5 start="\<\%(scan\|gsub\)\s*/"lc=4 start="\<sub\s*/"lc=3 end="/[iomx]*" skip="\\\\\|\\/" contains=@rubyStringSpecial
+syn region rubyString matchgroup=rubyStringDelimiter start="=>\s*/"lc=2 start="\<split\s*/"lc=5 start="\<\%(scan\|gsub\)\s*/"lc=4 start="\<sub\s*/"lc=3 end="/[iomx]*" skip="\\\\\|\\/" contains=@rubyStringSpecial
 
 " Normal String and Shell Command Output
 syn region rubyString matchgroup=rubyStringDelimiter start="\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial


More information about the vim-ruby-devel mailing list