# Add support for \`diff.plus\` and \`diff.minus\` highlight captures \(\#45459\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/e0b9c3afd01d30d37732467ed7d885152da1da95)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: e0b9c3afd01d30d37732467ed7d885152da1da95

Requested commit: e0b9c3afd01d30d37732467ed7d885152da1da95

Commit: e0b9c3afd01d30d37732467ed7d885152da1da95

Tree: 67373d763bfc167422bbaa410aa586d4c47b27b8

Author: Bret Comnes

Committer: GitHub

## Message

```
Add support for `diff.plus` and `diff.minus` highlight captures (#45459)

- 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 https://github.com/zed-industries/zed/issues/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:*

<img width="689" height="566" alt="Screenshot 2025-12-20 at 10 58 34 AM"
src="https://github.com/user-attachments/assets/b7ae4428-2011-4ec2-a803-7e30599e1715"
/>

*After:*

<img width="659" height="548" alt="Screenshot 2025-12-20 at 10 58 30 AM"
src="https://github.com/user-attachments/assets/02df31b5-1f1a-40af-adf0-1ac34457cdd4"
/>

*Before:*

<img width="650" height="545" alt="Screenshot 2025-12-20 at 10 58 16 AM"
src="https://github.com/user-attachments/assets/78b348bd-1b91-478b-a850-8e526adcfb3c"
/>

*After:*

<img width="627" height="563" alt="Screenshot 2025-12-20 at 10 58 21 AM"
src="https://github.com/user-attachments/assets/1176d626-563f-455a-9902-137f646eb8f2"
/>

*Before:*

<img width="628" height="550" alt="Screenshot 2025-12-20 at 10 58 06 AM"
src="https://github.com/user-attachments/assets/d819f478-bb2d-4afd-8013-c4e1a2f64dfe"
/>

*After:*

<img width="643" height="642" alt="Screenshot 2025-12-20 at 10 56 00 AM"
src="https://github.com/user-attachments/assets/e0f03549-77ed-4a47-b1da-239b519b90f4"
/>

---------

Co-authored-by: Finn Evers <finn.evers@outlook.de>
Co-authored-by: MrSubidubi <finn@zed.dev>
```

## Parents

- [a7248e8c006af22263d97e4eb234cb613a9bf605](https://git.cafe/gitcafe/zed/commit/a7248e8c006af22263d97e4eb234cb613a9bf605?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/e0b9c3afd01d30d37732467ed7d885152da1da95?format=markdown)
