Matchit and parentheses

Nikolai Weibull now at bitwi.se
Mon May 1 14:59:59 EDT 2006


On 5/1/06, Nikolai Weibull <now at bitwi.se> wrote:
> On 5/1/06, Doug Kearns <dougkearns at gmail.com> wrote:
> > On Mon, May 01, 2006 at 11:36:36AM +0200, Nikolai Weibull wrote:
> > > On 5/1/06, Doug Kearns <dougkearns at gmail.com> wrote:
> > > > On Sun, Apr 30, 2006 at 02:31:56PM +0200, Nikolai Weibull wrote:
> > > > > Why not add ",(:),{:},[:]" to the end of b:match_words so that we take
> > > > > advantage of our knowledge of the language to skip parentheses and
> > > > > braces and so on inside comments?
> > > >
> > > > Seems like a good idea.
> > > >
> > > > Hmmm, it doesn't seem to work for me though...
> >
> > <snip>
> >
> > > works for me.
> >
> > So the commented ']' is skipped?
> >
> > [1,
> >   # ]
> >   2,
> >   3,
> >   4]
>
> No.  The commented '}' is skipped.
>
> { a => 1,
>   b => 2 # Set b to 2 }
> }
>
> The "[...]" don't match up because matchit.vim doesn't escape the '[' and ']'...

I'm thinking too much.  Just escape the '[' and ']' metacharacters and
it works fine.

  nikolai



More information about the vim-ruby-devel mailing list