[PATCH] Improved iterator matching, show whitespace errors
Doug Kearns
dougkearns at gmail.com
Mon Apr 4 09:15:04 EDT 2005
On Thu, Mar 31, 2005 at 12:32:31AM +1000, Doug Kearns wrote:
> On Tue, Feb 08, 2005 at 08:31:48PM +0100, Tilman Sauerbeck wrote:
> > Hi,
> > I sent these two patches to Doug Kearns 1-2 weeks ago, but I didn't get
> > any feedback, so I'm posting them here now :)
> >
> > ruby.vim-iterator.diff improves the regex for iterators, so that it now
> > correctly recognizes and hilights |(foo, bar)| for example.
>
> <snip>
>
> > Index: syntax/ruby.vim
> > ===================================================================
> > RCS file: /var/cvs/vim-ruby/vim-ruby/syntax/ruby.vim,v
> > retrieving revision 1.39
> > diff -u -r1.39 ruby.vim
> > --- syntax/ruby.vim 27 Nov 2004 14:44:37 -0000 1.39
> > +++ syntax/ruby.vim 29 Jan 2005 21:13:33 -0000
> > @@ -59,7 +59,7 @@
> > syn match rubySymbol ":\@<!:\$\%(-.\|[`~<=>_,;:!?/.'"@$*\&+0]\)"
> > syn match rubySymbol ":\@<!:\%(\$\|@@\=\)\=\h\w*[?!=]\="
> > syn region rubySymbol start=":\@<!:\"" end="\"" skip="\\\\\|\\\""
> > - syn match rubyIterator "|[ ,a-zA-Z0-9_*]\+|" display
> > + syn match rubyIterator "|[ ,a-zA-Z0-9_*()]\+|" display
>
> What if we make it a little more constrained with something like:
>
> syn match rubyIterator "|[ ,a-zA-Z0-9_*]\+|" display
> syn match rubyIterator "|\s*(\s*[ ,a-zA-Z0-9_*]\+\s*)\s*|" display
Committed. It's still pretty loose...
<snip>
Regards,
Doug
More information about the vim-ruby-devel
mailing list