Skip to content

Commit 23302ac

Browse files
authored
Merge pull request #290 from emreyolcu/inline-underline
diff-hl-show-hunk-inline: Put underline at descent line
2 parents 2f1623d + b3aedcb commit 23302ac

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

diff-hl-show-hunk-inline.el

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ Compute it from LINES starting at INDEX with a WINDOW-SIZE."
105105
(index (min index (- len window-size))))
106106
(diff-hl-show-hunk-inline--splice lines index window-size)))
107107

108+
(defun diff-hl-show-hunk-inline--underline-face ()
109+
"Return the face used for inline popup underlines."
110+
`(:underline ,(if (>= emacs-major-version 29) '(:position t) t)))
111+
108112
(defun diff-hl-show-hunk-inline--compute-header (width &optional header)
109113
"Compute the header of the popup.
110114
Compute it from some WIDTH, and some optional HEADER text."
@@ -115,7 +119,7 @@ Compute it from some WIDTH, and some optional HEADER text."
115119
(new-width (- width (length header) (length scroll-indicator)))
116120
(line (propertize (concat (diff-hl-show-hunk-inline--separator new-width)
117121
header scroll-indicator )
118-
'face '(:underline t))))
122+
'face (diff-hl-show-hunk-inline--underline-face))))
119123
(concat line "\n") ))
120124

121125
(defun diff-hl-show-hunk-inline--compute-footer (width &optional footer)
@@ -133,7 +137,7 @@ Compute it from some WIDTH, and some optional FOOTER text."
133137
(blank-line (if (display-graphic-p)
134138
""
135139
(concat "\n" (propertize (diff-hl-show-hunk-inline--separator width)
136-
'face '(:underline t)))))
140+
'face (diff-hl-show-hunk-inline--underline-face)))))
137141
(line (propertize (concat (diff-hl-show-hunk-inline--separator new-width)
138142
footer scroll-indicator)
139143
'face '(:overline t))))

0 commit comments

Comments
 (0)