Open adambarjo opened 1 week ago
I agree, I think the current diff highlights need some work. I also agree that the fg
should not be set. Using a simple/straightforward or the recommended config, they also get overridden by the highlights for/in: https://github.com/projekt0n/github-nvim-theme/blob/4f44a5c930372c85483d02700f332d34417e50b2/lua/github-theme/group/modules/diffchar.lua#L1-L14
although this module could be manually disabled via config. I'm not sure if this override is intentional or not.
What would really be cool is something like this:
which is something that I've been working lately for my own setup. To get something like this though, it requires more than just setting highlights (e.g. custom 'statuscolumn'
, 'winhl'
settings, etc.), and I'm also implementing it on top of diffview.nvim to make things nicer and a bit easier. Maybe we should add a diffview module too.
Also IMO diffAdded
and DiffAdd
etc. probably shouldn't be linked as they are now. In contrast, the former probably does work better with an fg
setting, and typically gets used in situations where there is no highlighting otherwise (e.g. diff
filetype, patch files, diff status indicator chars like in Telescope git status/commits). For example:
Reconcile the conflicts/overlap between diff mode highlights and diffchar
module. Personally idk how diffchar works and don't use it, but perhaps we ought to prioritize the regular diff mode experience over it (if they share the same hl groups). It might be too challenging to try to give them both nice/correct defaults at the same time?
Fixup diff mode highlights (i.e. DiffAdd
etc.): don't set their fg
, unlink them from diff
filetype highlights used for patch files. Also improve DiffText
in the process.
Maybe add more advanced diff highlighting in order to make it look like GitHub.com, although this is more complicated and may require the user to use a plugin like diffview so that there is a foundation to build upon. Maybe we'd just implement this via a diffview
module, separate from the regular diff mode highlights?
Hello! I've been trying out this theme in the past few weeks and have been really enjoying using it. It's probably the most well-rounded and polished theme I've come across. One area I found this theme to be slightly weaker than others is inside diff views. Particularly for the
DiffText
highlight group, it's really quite difficult to see the text within the line that has changed. In addition, the syntax highlighting is not preserved for changed and added code. Having the syntax highlighting preserved makes reading the diff more useful and matches GitHub's own diff style more closely. As well, other popular themes such as Catppuccin and Rose-pine preserve syntax highlighting in their diffs, it seems to be standard.Below is an example of how the change looks.
Before:
After:
I have looked closely at all the different theme variations to make sure this change looks good on them. I am fairly new to contributing to open source, but trying to give it a go more regularly. Please feel free to give any feedback. Thanks