rubyFunction, rubyClass, and rubyModule no longer highlighted

Tim Pope vim-ruby-devel at
Tue Feb 20 11:10:25 EST 2007

On Tue, Feb 20, 2007 at 09:36:49PM +1100, Doug Kearns wrote:
> On Sun, Feb 18, 2007 at 08:07:21PM -0600, Tim Pope wrote:
> > I made a major change to how string interpolation works; try it out.
> This has been tinkered with before using the same method you've used
> and, from memory, it broke with some reasonably common nested string
> constructs.  Unfortunately, when string highlighting goes awry it tends
> to result in a rather bright red page. :)  So, the cop-out (err
> compromise) was to highlight the simple one line interpolation sequences
> and fall back to the standard string highlighting for the multi-line
> interpolation sequences - yuck!

I have found this pattern to be more robust than the plain
highlighting it replaces.  Consider this excerpt from
test/test_helper.rb in Beast.  It works fine with my new pattern but
leaves the rest of the file as a string with the old one.

    @request.env["HTTP_AUTHORIZATION"] = user ? "Basic #{Base64.encode64("#{users(user).login}:testy")}" : nil

> Now that we've got some extra man power and motivation on board (thanks)
> it would be great to get this sorted out.  I've had a quick look through
> the standard library files and with a couple of small exceptions, which
> I'll fix, it seems to work fine.  The third party libraries are usually
> less straight forward but, as usual, once it's sent out into the world
> we're sure to hear about where it doesn't work in quick time. :)

If you can point me to an example, I'd love to see it.

> I notice you haven't enhanced the highlighting, in kind, for #@foo and
> similar.  I assume that's just an oversight?

Laziness, coupled with the fact that I don't consider this as critical
because there isn't really any "syntax" so the highlighting is just
cosmetic.  I'll probably fix it sooner or later; feel free to beat me
to it.

> My only concern with this change is it seems to be pushing us further
> towards a saturated kaleidoscope of colour. ;-)

I'm undecided as to whether the area inside the #{} should receive
delimiter highlighting or not.  I've coded my current inclination.
I'm also wondering if it'd look a bit better to highlight string
quotes as plain strings, not delimiters.  Yes, they are delimiters,
but it seems to be an unusual practice to highlight them as such, and
it seems to be to reduce the impact of string escape sequences and
interpolation, which I think are more important.



More information about the vim-ruby-devel mailing list