On Sat, 3 Aug 2002, Kyle Rawlins wrote:

> [...]  The following code highlights/folds
> wrong for me [...]
>
> while (var)
>     fun() do
>         print "hello\n"
>     end
> end
        [...]
> happening; the line in syntax/ruby.vim for rubyOptDoBlock has a
> 'contains' that among other stuff has
> "ALLBUT,rubyDoBlock,rubyCurlyBlock" in it.  I guess this is so that the
> optional 'do' for the while-type statements will not be matched as a
> rubyDoBlock, but it prevents any ruby blocks directly inside the 'while'
> from being matched correctly.  If I insert an if statement or something
        [...]

I believe that my mods to the Ruby syntax file introduced folding.
Basically, all I did was add "fold" to the lines that seemed
appropriate, and when I did
set fdm=syntax
it worked.  So I admit that I was "meddling in the affairs of
wizards", but I got away with it that time!  This post is to point
out that I did not look in great detail at the syntax highlighting,
and certainly not enough to correct this problem.

It might be worth asking on the vim list how this should be fixed.
Off the top of my head, I can't think of any other langauges with
optional keywords in this sort of context, though I know I have
encountered this sort of thing before, because I never thought it
odd when I saw it in Ruby.

> thanks,
> -kyle

        Hugh