As reported by A. S. Budden, CSApprox caused the set GUI colors to be
overwritten when the cterm colors were set. This happened because vim
attempts to reset some colors back to their defaults whenever the colors
for the Normal group change by calling syntax/syncolor.vim (I couldn't
find any documentation that explained this behavior). The global
syncolor.vim allows any syncolor.vim before it in the runtimepath to
override its behavior by setting the variable g:syntax_cmd to something
not recognized, so I now work around this problem by doing exactly that
for the duration of the run.
See http://groups.google.com/group/vim_use/msg/2c6a7f5917f76057
Before, we would break the loop if we hit a highlight group with an
empty name. In that case, we should actually continue the loop.
I moved the loop index increment to the beginning of the loop to make
this easier.
The default approximator has been modified to cache both the sorted list
of all possible components and the closest cterm color to a given rgb
color - drops execution time by about one quarter.
Vim allows highlight groups with no name to be created; but doesn't
support getting any information for them. Two commas in a row in a
"syn match" creates a new highlight group that's named "". This bug is
triggered by the distributed doxygen.vim.
syn match doxygenStartSkip2 +^\s*\*$+ contained
\ nextgroup=doxygenBody,doxygenStartSpecial,,doxygenStartSkip skipwhite skipnl
^^