Skip to content
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

make diff-highlight use ordinary configurable colors #625

Merged
merged 1 commit into from
Jun 29, 2017

Conversation

rolandwalker
Copy link
Contributor

diff-add-highlight and diff-del-highlight become ordinary colors independently governing the fg/bg/attributes of the highlighted cells.

These entries are added to the system tigrc such that the out-of-box configuration is unchanged, though if the user previously customized some diff colors, diff highlight cells will not follow them automatically.

Rationale: independent coloring of four states matches functionality of diff-highlight itself. Net reduction of logic. Dimmer colors for the backgrounded regions are a readability improvement.

src/line.c Outdated
assert(type < line_rules);
rule = &line_rule[type];

/* special highlight types are not prefix-dependent */
if ((type == LINE_DIFF_ADD_HIGHLIGHT) || (type == LINE_DIFF_DEL_HIGHLIGHT))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would make sense to allow stage.diff-add-highlight to use a different color in the stage view, but I don't feel strongly about that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not, when deleting code adds the feature.

Copy link
Owner

@jonas jonas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great cleanup. Makes me wonder why I didn't think of doing it myself.

@rolandwalker rolandwalker force-pushed the diff-highlight-configurable branch from 2939b35 to 10aa3f6 Compare June 29, 2017 22:42
@rolandwalker rolandwalker force-pushed the diff-highlight-configurable branch from 10aa3f6 to c02aa82 Compare June 29, 2017 22:43
@jonas jonas merged commit 7dc84f5 into jonas:master Jun 29, 2017
@jonas
Copy link
Owner

jonas commented Jun 29, 2017

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants