Function: magit-diff-highlight-hunk-region-using-underline

magit-diff-highlight-hunk-region-using-underline is a byte-compiled function defined in magit-diff.el.

Signature

(magit-diff-highlight-hunk-region-using-underline SECTION)

Documentation

Emphasize the hunk-internal region using delimiting horizontal lines.

This is implemented by overlining and underlining the first and last (visual) lines of the region.

Source Code

;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-diff.el
(defun magit-diff-highlight-hunk-region-using-underline (section)
  "Emphasize the hunk-internal region using delimiting horizontal lines.
This is implemented by overlining and underlining the first and
last (visual) lines of the region."
  (if (window-system)
      (let* ((beg (magit-diff-hunk-region-beginning))
             (end (magit-diff-hunk-region-end))
             (beg-eol (save-excursion (goto-char beg)
                                      (end-of-visual-line)
                                      (point)))
             (end-bol (save-excursion (goto-char end)
                                      (beginning-of-visual-line)
                                      (point)))
             (color (face-background 'magit-diff-lines-boundary nil t)))
        (cl-flet ((ln (b e &rest face)
                    (magit-diff--make-hunk-overlay
                     b e 'font-lock-face face 'after-string
                     (magit-diff--hunk-after-string face))))
          (if (= beg end-bol)
              (ln beg beg-eol :overline color :underline color)
            (ln beg beg-eol :overline color)
            (ln end-bol end :underline color))))
    (magit-diff-highlight-hunk-region-using-face section)))