Martin Toft's

Google Summer of Code Blog

Friday, July 6, 2007

It's alive!

Now nothing will stop you from going absolutely crazy with highlights in Vim:

It's alive!

As hinted in my previous post, the bug

  • Allow more than 3 ":match" items.

turned out to be more of a feature addition than a bug. The limit was literally hardcoded everywhere in the Vim source code and major changes were unavoidable. I have implemented the functionality as functions, as it will be used mostly by scripts (probably). Example of usage:

:highlight MyGroup1 ctermfg=yellow ctermbg=blue
:highlight MyGroup2 ctermfg=white ctermbg=red
:let m1 = matchadd("MyGroup1", "TODO")
:let m2 = matchadd("MyGroup2", "FIXME")
:call matchdelete(m1)
:call matchdelete(m2)

I still need to change the underlying code for the old :match command, so it will use the new data structures transparently. Also, I plan to create a matchlist function and to write some tests for all this new stuff in Vim's testdir.

Other posts

What I've fixed since the previous post (Friday, August 3, 2007)
Finally I'm hacking! (Thursday, July 5, 2007)
First post (Monday, April 16, 2007)