microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.51k stars 29.39k forks source link

Diff editor character diff should use stronger colour #153563

Closed isidorn closed 2 years ago

isidorn commented 2 years ago

We have very smart character diffing algorithm done by @hediet However our character level diff colours are not so strong, and they easily blend in with the rest of the green.

@misolori could we try to introduce some stronger colour to make this nice feature more prominent?

Screenshot 2022-06-28 at 20 06 40

hediet commented 2 years ago

The diffing is actually implemented by Alex ;) We should try to use the same color for diffing and merging highlights.

isidorn commented 2 years ago

fyi @daviddossett since Miguel is on vacation. Though this is not urgent.

miguelsolorio commented 2 years ago

I wonder if we'd need to introduce another color token specifically used when diffing to be stronger when it's on a diffed line?

hediet commented 2 years ago

But usually word diffs are on a diffed line 🤔

miguelsolorio commented 2 years ago

@hediet you are right, I thought this was word match on a diff line. In this case, we can increase the opacity level, but it will also impact all other diff backgrounds (like when new lines are added). I will set up a PR for this to test out.

gdh1995 commented 2 years ago

Hello, today my VS Code updated to v1.70 and I think the background color of .char-insert (diffEditor.insertedTextBackground) is a bit too "strong" for the theme of Light+ on a TypeScript file, since the theme tends to make some symbol names not black but colorful.

Here's what I saw: image

I've reverted diffEditor.insertedTextBackground in my settings.json, and IMO it's enough. So here I want to suggest re-thinking about those colors and contrast ratios.

BTW, "diff colors" used by GitHub webpages look good enough, though they're not transparent