-
Notifications
You must be signed in to change notification settings - Fork 347
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
Redo of background colors to improve diff readability #690
base: master
Are you sure you want to change the base?
Conversation
NOTE: There appears to be a bug in testing. Lines in the left hand side are being colored green in some cases.
NOTE: This version does not compile due to a conflict between some remaining owo_colors types and some yansi types.
NOTE: Colors need adjusting. Sub-line differences seem to have the same background color as the rest of the line.
Use color theme for default background colors.
This looks better. |
No. If you have more detail about what you'd like to see in custom theme support please share. Right now, I have implemented this in a way that could support custom themes, specifically
|
@gerhardol Is this what you have in mind? |
More or less those links. But using the same names for the slot (with some additions and deletions) would simplify. Difftastic is more than Git, but as Git is dominant, at least configuration and documentation is simpler if the concepts ar the same. In my case to use Difftastic as a difftool from within another tool, I would need some way to control tis at runtime, prefeably with environment variables. So a comma separated list with the Git names of the slots is my preference. A user may want other colors from the command line and use other theme colors when embedded in the app. A sidetrack... Will try to build and try this branch myself |
This is a complete rewrite of #286 on top of the current version of
difftastic
(with the exception of the last cargo update which is causing a compilation error for me #689).Previous Issues
Hopefully this addresses the issues that @Wilfred mentioned in the last pull request:
6
inVersion 0.6
) and delimiters (the(
beforereverse
) is missing: not sure about this, please let me know if you still see this issueThemes
This pull request lays the groundwork for theming of
difftastic
in the future. The missing piece here is the ability to parse theme information from a config file. Internally, the various styles are stored in aHashMap
and a lookup with fallback is performed when retrieving various values.Notes and Caveats
While this is a decent proof of concept there are probably a few issues in need of attention:
NO_COLOR
is not currently supported even thoughyansi
supports conditional styling quite well.Reasoning
I'm creating this pull request now, in spite of it not being finished, since I'd like feedback on the above.