-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Store extended colors in v:colornames dict. #8761
Conversation
Codecov Report
@@ Coverage Diff @@
## master #8761 +/- ##
==========================================
+ Coverage 90.10% 90.13% +0.02%
==========================================
Files 151 151
Lines 169669 169787 +118
==========================================
+ Hits 152879 153030 +151
+ Misses 16790 16757 -33
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
0241aa1
to
db15e0d
Compare
db15e0d
to
dc262ba
Compare
@chrisbra I finally had a chance to fix the test failures on this branch. Mind approving the test run again? |
of course! |
dc262ba
to
0c40041
Compare
For default.vim, instead of calling has_key() for every entry, you can use extend(v:colornames, {dict with values}, 'keep') I notice that the loopup in rgb_table[] just uses a linear search. A binary search would be much better. Otherwise, I'll leave this open for remarks. Is using v:colornames the best solution? |
My original motivation for using |
I've pushed an additional commit that requires uses |
See the runtime files for examples of how the 'cpo' option is changed and restored to allow for line continuation. Basically:
|
Setting and restoring 'cpo' will also be needed in csscolors.vim |
Drew - have you looked into fixing the line continuation? |
Yeah the color lists included in the patch all use the line continuations with the compatibility flag save/restore pattern you suggested. I haven't had a chance to look into the merge conflicts that arose from the refactor of the highlighting code yet. |
Problem solved: Remembering RGB colors is difficult. Solution: Allow user to (re-)define new color names.
5adc3a2
to
9b8d88b
Compare
Looks like it was just a conflict due to a tiny comment correction I made. I've rebased this branch atop the |
Problem solved: Remembering RGB colors is difficult.
Solution: Allow user to (re-)define new color names.
This patch is a follow-up to the discussion on #8502.
A central question in that discussion was how users would put the new
v:colornames
dict to use and whether a single shared dict was appropriate. My own opinion is that a single shared dict is simultaneously the most approachable and the most usable. I've extended my previous work in an attempt to demonstrate why I think that is the case.rgb.txt
file while retaining the same list of colors.v:colornames
, thergb.txt
colors are put into a default color list, which is re-executed when a user would have expected thergb.txt
colors to be valid.Finally, the color name code has been moved into
highlight.c
as suggested by @brammool. Thanks to Bram, @chrisbra, and @romainl for the helpful feedback on the last PR. I'm looking forward to any feedback you all have on this update/alternative.