Skip to content

Conversation

@bcomnes
Copy link
Contributor

@bcomnes bcomnes commented Dec 20, 2025

  • Update diff in highlights.scm to use semantic @diff.plus and @diff.minus tokens
  • Add diff.plus, diff.minus tokens to fallback theme
  • Add diff syntax tokens to all official themes (One, Gruvbox, Ayu)

This fixes the issue where diff files showed inverted colors (additions in purple/blue, deletions in green) by using proper semantic tokens instead of @string and @Keyword.

Related discussion in #34057 (thought there might be second issue in that issue)

Release Notes:

  • Added support for diff.plus, diff.minus and diff.deleta theme selectors in the diff syntax grammar. Previously diff.plus was mapped to @string and diff.minus was mapped to @Keyword.

Before:

Screenshot 2025-12-20 at 10 58 34 AM

After:

Screenshot 2025-12-20 at 10 58 30 AM

Before:

Screenshot 2025-12-20 at 10 58 16 AM

After:

Screenshot 2025-12-20 at 10 58 21 AM

Before:

Screenshot 2025-12-20 at 10 58 06 AM

After:

Screenshot 2025-12-20 at 10 56 00 AM

- Update diff/highlights.scm to use semantic @diff.plus and @diff.minus tokens
- Add diff.plus, diff.minus, diff.delta tokens to fallback theme
- Add diff syntax tokens to all official themes (One, Gruvbox, Ayu)

This fixes the issue where diff files showed inverted colors (additions in
purple/blue, deletions in green) by using proper semantic tokens instead of
@string and @Keyword.
Copilot AI review requested due to automatic review settings December 20, 2025 19:16
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Dec 20, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes inverted diff colors by introducing proper semantic tokens @diff.plus and @diff.minus for diff syntax highlighting, replacing the previous use of generic @string and @keyword tokens.

  • Updated diff syntax grammar to use semantic tokens @diff.plus and @diff.minus
  • Added diff.plus and diff.minus theme selectors to fallback theme and all official themes
  • Removed TODO comments that were tracking this improvement

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
crates/languages/src/diff/highlights.scm Replaced @string with @diff.plus and @keyword with @diff.minus for addition/deletion highlighting, removed TODO comments
crates/theme/src/fallback_themes.rs Added diff.plus (green) and diff.minus (red) tokens to the default dark theme
assets/themes/one/one.json Added diff.plus and diff.minus theme selectors to both One Dark and One Light themes
assets/themes/gruvbox/gruvbox.json Added diff.plus and diff.minus theme selectors to all six Gruvbox variants (dark, light, and their contrast variants)
assets/themes/ayu/ayu.json Added diff.plus and diff.minus theme selectors to all three Ayu variants (dark, mirage, and light)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement community champion

Projects

Status: Community PRs

Development

Successfully merging this pull request may close these issues.

1 participant