You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to set up overlay highlights for mini.diff so that it looks like a standard diff: changed lines highlighted red in the source and green in the buffer.
While right now mini.diff has a highlight group MiniDiffOverAdd for added buffer lines, there is no highlight group that spans entire changed buffer lines.
Additionally, setting the MiniDiffOverChange background to None doesn't fall through to the MiniDiffOverContext background, leaving an unaesthetic gap in the context line background.
For reference, this is how I'd like to color mini.diff overlays:
This is how they can be colored right now:
The text was updated successfully, but these errors were encountered:
The current design is more aligned with how built-in Neovim diff does it (see :h diff). I'll think about possibly a less intrusive way of achieving GitHub like highlighting, but preserving the current one is still a priority.
The best thing to do right now seems to be link MiniDiffOverChange to MiniDiffOverContext (or make it have background with a slightly different shade). So something like this: vim.api.nvim_set_hl(0, 'MiniDiffOverChange', { link = 'MiniDiffOverContext' }).
I think both styles can be supported with these groups:
MiniDiffOverAdd – full added line
MiniDiffOverDelete – full deleted line
MiniDiffOverChange – changed text
MiniDiffOverContext – full changed source line (modified to span the full line without gaps)
MiniDiffOverChangeLine – full changed buffer line, unstyled by default (new)
If you wanted to support GitHub-style highlighting where the changed text gets a slightly darker red/green background:
MiniDiffOverAdd – full added line
MiniDiffOverDelete – full deleted line
MiniDiffOverChange – changed text
MiniDiffOverChangeSource – changed text in source, links to MiniDiffOverChange by default (new)
MiniDiffOverChangeBuffer – changed text in buffer, links to MiniDiffOverChange by default (new)
MiniDiffOverContext – full changed source line (modified to span the full line without gaps)
MiniDiffOverChangeLine – full changed buffer line, unstyled by default (new)
The "Neovim diff" style can still be the default, and anyone who wants a more traditional style will be able to accomplish it by updating the highlight groups.
Contributing guidelines
Module(s)
mini.diff
Description
I would like to set up overlay highlights for mini.diff so that it looks like a standard diff: changed lines highlighted red in the source and green in the buffer.
While right now mini.diff has a highlight group
MiniDiffOverAdd
for added buffer lines, there is no highlight group that spans entire changed buffer lines.Additionally, setting the
MiniDiffOverChange
background toNone
doesn't fall through to theMiniDiffOverContext
background, leaving an unaesthetic gap in the context line background.For reference, this is how I'd like to color mini.diff overlays:
This is how they can be colored right now:
The text was updated successfully, but these errors were encountered: