# Objective When diff hunks are expanded, reading the line numbers can be a little hard due to the contrast between `editor.line_number` and both `editor.diff_hunk.deleted.background` and `editor.diff_hunk.added.background`. In order to make it easier for these line numbers to stand out, the actual `version_control` colors, respective to each diff hunk, can be used to color the line number. ## Solution Luckily, the line numbers color was already dynamically decided on `EditorElement::layout_line_numbers` depending on whether the line had a breakpoint or it was active (part of a selection). The information on whether the row for which the line was being laid out belonged to a diff hunk is also already available on the `Gutter::row_infos`. As such, this change was easy to achieve by simply updating `EditorElement::layout_line_numbers` to take into consideration each row's `RowInfo::diff_status` and mapping each status to a `version_control` color, ignoring the `Modified` variant, as that should never happen. ## Testing Manually tested against a repository that has added, deleted and modified changes. Differences can be seen in the `Showcase` section. ## Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [ ] Unsafe blocks (if any) have justifying comments - [x] The content adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [ ] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable ## Showcase <details> <summary>Before</summary> <img width="2744" height="2994" alt="version_control_line_numbers_before" src="https://github.com/user-attachments/assets/75d160a7-e0cc-4c9d-8fdd-4cab5cc6eefb" /> </details> <details> <summary>After</summary> <img width="2744" height="2994" alt="version_control_line_numbers_after" src="https://github.com/user-attachments/assets/887fdb6a-34c6-4331-b750-4d3bea6fcd77" /> </details> --- Release Notes: - Improved line number colors in diff hunks to match the version control colors
1 file changedLine totals unavailable