Commit Graph

66 Commits

Author SHA1 Message Date
Matt Wozniski
084ad4cc01 Initial support for creating 88/256 color schemes
Added a new function, CSApproxSnapshot(filename [, force=0]).  This
function will take the current colors and dump them out to a new
colorscheme script stored at `filename', unless that file already exists
and `force' is not set.  This may still have some bugs to work out, I'm
surprised it was this easy...  Not surprisingly, it falls apart if the
colorscheme didn't set g:colors_name...  And it doesn't handle
highlights the user made himself, outside of the scheme.  Still, it's
a good first draft.
2009-01-15 13:19:43 -05:00
Matt Wozniski
cb1d299c94 Update changelogs/timestamps for 1.10 release 2009-01-15 13:19:43 -05:00
Matt Wozniski
ddb4da57bc Distribute an rgb.txt with CSApprox.
Add the most recent rgb.txt from upstream as part of the package,
installed to ~/.vim.  Accordingly, CSApprox.vim will now search in all
dirs in &rtp, in order, before deciding that no rgb.txt could be found.
2009-01-15 13:19:42 -05:00
Matt Wozniski
5703a98365 Finish CSApprox 1.0 release
- Update "Last Changed", version number, and changelog

- Suggest installing larger vim packages as a workaround for no +gui

- Modify the way g:CSApprox_verbose_level works; now 'verbose' is set to
  the max of that variable and &verbose

- Fix a minor bug causing a complaint that not enough colors are
  available when changing colorschemes after a :gui

- Fix some comments
2009-01-15 13:19:42 -05:00
Matt Wozniski
c0bd88e741 Fix an important bug in CSApprox.
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
2009-01-15 13:19:42 -05:00
Matt Wozniski
09e4f32e67 Fix minor typo in CSApprox help 2009-01-15 13:19:42 -05:00
Matt Wozniski
6643594d33 Updated docs for speed improvements 2009-01-15 13:19:42 -05:00
Matt Wozniski
ea294285a1 Fix a stupid bug - recalculating highlight groups
Also, cleans up the rgb.txt hashing by making the values be #rrggbb
instead of just rrggbb
2009-01-15 13:19:42 -05:00
Matt Wozniski
c3e7c42207 Clean up some ugly code in s:Highlights() 2009-01-15 13:19:42 -05:00
Matt Wozniski
94d110f5a5 Fix some broken logic gathering highlights
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.
2009-01-15 13:19:42 -05:00
Matt Wozniski
7b00efcb8f Speed tweak - reorganize a loop 2009-01-15 13:19:42 -05:00
Matt Wozniski
46f20b0782 CSApprox speedup - caching in approximator
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.
2009-01-15 13:19:42 -05:00
Matt Wozniski
60e43e82d0 Fix broken behavior in compatible mode. 2009-01-15 13:19:42 -05:00
Matt Wozniski
c1a258526b Work around another vim bug.
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
                                           ^^
2009-01-15 13:19:42 -05:00
Matt Wozniski
fa556ebcd8 Completed beta release of CSApprox.vim 2009-01-15 13:18:20 -05:00
Matt Wozniski
48ce53f0d4 Initial commit 2009-01-15 13:17:50 -05:00