Add customizable inline hunk faces#279
Conversation
|
Hey, this is interesting. Some notes:
|
OK!
I did not realize this before you mentioned it (that the grey color I settled on actually matches closely the default active mode-line). I tried selecting a neutral color that would not stand out but still worked with the "standard" red/green diff-colors and at the same time separated from the rest of the buffer. With that said I am not sure it would be such a good idea to connect these (grey) separators with the color of the active mode-line. What happens if the active mode-line is set to a color that is close to one of the diff-colors, the 'diff-hl-show-hunk-face', or clashes severely with the other colors? My gut-feeling tells me that it is a good idea to have full control over the selected colors within diff-hl for things like separators as you could otherwise get "interesting" surprises when relying on other already existing face definitions.
I admit that I struggled with this one. I finally settled on it in an attempt for a neutral off-white color for the region representing what is within the buffer so it stands out against the diff (the idea was to highlight what the diff is about) but at the same time have a low risk of interfering with any font-locking going on. I agree wholeheartedly on that 'old lace' is not ideal, but I had a hard time coming up with something better... I am of course open to other suggestions here as well. :-)
Ok!
Sorry about that! Will remove in the updated PR. |
Add two cusomizable faces (four in total)
- diff-hl-show-hunk-bg
Background color for changed region when hunk is shown. This face is used
for creating an overlay that tints the background for the current lines of
the changed region in the buffer when viewing the hunk.
- diff-hl-show-hunk-inline-base
Foreground and background colors for the header and footer when viewing a
hunk.
- diff-hl-show-hunk-inline-ul
Inherits from diff-hl-show-hunk-inline-base and adds an underline to the
face.
- diff-hl-show-hunk-inline-ol
Inherits from diff-hl-show-hunk-inline-base and adds an overline to the
face.
Modifies diff-hl-show-hunk--click function so mouse clicks toggles showing the
hunk on and off.
e3e6258 to
1c21121
Compare
I suspect that it won't: any consistent theme will have separate diff mode colors and the mode-line. We don't have to adopt mode line's face specifically. Just if we don't, that creates a case of so-called "uncanney valley" with the colors beeing too close but not the same, and without paricular artistic purpose in that difference. We can try some other built-in face with related gamma.
Right. I think we'll merge this face as-is, and whatever feedback arrives will be after. |

Add two cusomizable faces (four in total)
diff-hl-show-hunk-bg Background color for changed region when hunk is shown. This face is used for creating an overlay that tints the background for the current lines of the changed region in the buffer when viewing the hunk.
diff-hl-show-hunk-inline-base Foreground and background colors for the header and footer when viewing a hunk.
diff-hl-show-hunk-inline-ul Inherits from diff-hl-show-hunk-inline-base and adds an underline to the face.
diff-hl-show-hunk-inline-ol Inherits from diff-hl-show-hunk-inline-base and adds an overline to the face.
Modifies diff-hl-show-hunk--click function so mouse clicks toggles showing the hunk on and off.