Skip to content

Add customizable inline hunk faces#279

Open
ermingol23 wants to merge 1 commit into
dgutov:masterfrom
ermingol23:show-inline-faces
Open

Add customizable inline hunk faces#279
ermingol23 wants to merge 1 commit into
dgutov:masterfrom
ermingol23:show-inline-faces

Conversation

@ermingol23

Copy link
Copy Markdown

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.

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.
@dgutov dgutov changed the title Add cusomizable inline hunk faces Add customizable inline hunk faces Jun 6, 2026
@dgutov

dgutov commented Jun 6, 2026

Copy link
Copy Markdown
Owner

Hey, this is interesting.

Some notes:

  • diff-hl-show-hunk-inline-base should either have "white" as the fg for dark themes, or probably no :foreground specification at all.
  • Its background looks like the active mode-line to me. Should it inherit from mode-line-active?
  • old lace is not ideal, but it's workable. Hope people take a look and suggest more options.
  • Other things being equal it's better to use named colors, I think.
  • Please don't add consecutive empty lines

@dgutov

dgutov commented Jun 6, 2026

Copy link
Copy Markdown
Owner

If anybody else looks at this PR, a picture:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants