I was somewhat confused as to who the current maintainer of the ruby
syntax file is, so I’m sending this to the whole list. I think this was
mentioned recently, but I just couldn’t seem to figure out who it is
from the archives; sorry about that.
I found a small bug in the syntax/folding that I’m not skilled enough
with syntax highlighting to fix. The following code highlights/folds
wrong for me (vim 6.1, tried a bunch of different versions of the
highlighting that I got from different places):
The problem seems to be that the ‘while’ is paired with the first ‘end’
and not the second as the end of that block. I figured out why this is
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
in between then everything is fine. If I use curly braces for the
block, the correct ‘end’ is matched for ‘while’ but the block inside is
still not detected (I can tell because there is no fold available there).
Again, apologies for not providing a solution but I just don’t know
enough about how the highlighting works to know the best way to do it.
Hopefully this isn’t fixed in some later version that I just haven’t
Let’s hear it for the vague blur!