Variable: magit-diff-highlight-hunk-region-functions

magit-diff-highlight-hunk-region-functions is a customizable variable defined in magit-diff.el.

Value

(magit-diff-highlight-hunk-region-dim-outside
 magit-diff-highlight-hunk-region-using-overlays)

Documentation

The functions used to highlight the hunk-internal region.

magit-diff-highlight-hunk-region-dim-outside overlays the outside of the hunk internal selection with a face that causes the added and removed lines to have the same background color as context lines. This function should not be removed from the value of this option.

magit-diff-highlight-hunk-region-using-overlays and magit-diff-highlight-hunk-region-using-underline emphasize the region by placing delimiting horizontal lines before and after it. The underline variant was implemented because Eli said that is how we should do it. However the overlay variant actually works better. Also see https://github.com/magit/magit/issues/2758.

Instead of, or in addition to, using delimiting horizontal lines, to emphasize the boundaries, you may wish to emphasize the text itself, using magit-diff-highlight-hunk-region-using-face.

In terminal frames it's not possible to draw lines as the overlay and underline variants normally do, so there they fall back to calling the face function instead.

This variable was added, or its default value changed, in magit version 2.9.0.

Source Code

;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-diff.el
(defcustom magit-diff-highlight-hunk-region-functions
  (list #'magit-diff-highlight-hunk-region-dim-outside
        #'magit-diff-highlight-hunk-region-using-overlays)
  "The functions used to highlight the hunk-internal region.

`magit-diff-highlight-hunk-region-dim-outside' overlays the outside
of the hunk internal selection with a face that causes the added and
removed lines to have the same background color as context lines.
This function should not be removed from the value of this option.

`magit-diff-highlight-hunk-region-using-overlays' and
`magit-diff-highlight-hunk-region-using-underline' emphasize the
region by placing delimiting horizontal lines before and after it.
The underline variant was implemented because Eli said that is
how we should do it.  However the overlay variant actually works
better.  Also see https://github.com/magit/magit/issues/2758.

Instead of, or in addition to, using delimiting horizontal lines,
to emphasize the boundaries, you may wish to emphasize the text
itself, using `magit-diff-highlight-hunk-region-using-face'.

In terminal frames it's not possible to draw lines as the overlay
and underline variants normally do, so there they fall back to
calling the face function instead."
  :package-version '(magit . "2.9.0")
  :set-after '(magit-diff-show-lines-boundaries)
  :group 'magit-diff
  :type 'hook
  :options (list #'magit-diff-highlight-hunk-region-dim-outside
                 #'magit-diff-highlight-hunk-region-using-underline
                 #'magit-diff-highlight-hunk-region-using-overlays
                 #'magit-diff-highlight-hunk-region-using-face))