Skip to content

Commit f2424f7

Browse files
committed
diff-hl-show-hunk-inline: Enable customization of scroll indicators
1 parent 2f1623d commit f2424f7

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

diff-hl-show-hunk-inline.el

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,13 @@ the hunk consist only on added lines, then
7474
`diff-hl-show-hunk--no-lines-removed-message' it is shown."
7575
:type 'boolean)
7676

77+
(defcustom diff-hl-show-hunk-inline-scroll-indicators '(?⬆ . ?⬇)
78+
"Characters used to indicate hidden inline popup content.
79+
The car is used for hidden content above the popup; the cdr is used for
80+
hidden content below it."
81+
:type '(cons (character :tag "Above")
82+
(character :tag "Below")))
83+
7784
(defun diff-hl-show-hunk-inline--splice (list offset length)
7885
"Compute a sublist of LIST starting at OFFSET, of LENGTH."
7986
(butlast
@@ -108,7 +115,10 @@ Compute it from LINES starting at INDEX with a WINDOW-SIZE."
108115
(defun diff-hl-show-hunk-inline--compute-header (width &optional header)
109116
"Compute the header of the popup.
110117
Compute it from some WIDTH, and some optional HEADER text."
111-
(let* ((scroll-indicator (if (eq diff-hl-show-hunk-inline--current-index 0) " " ""))
118+
(let* ((scroll-indicator
119+
(if (eq diff-hl-show-hunk-inline--current-index 0)
120+
" "
121+
(string ?\s (car diff-hl-show-hunk-inline-scroll-indicators) ?\s)))
112122
(header (or header ""))
113123
(new-width (- width (length header) (length scroll-indicator)))
114124
(header (if (< new-width 0) "" header))
@@ -125,7 +135,7 @@ Compute it from some WIDTH, and some optional FOOTER text."
125135
(- (length diff-hl-show-hunk-inline--current-lines)
126136
diff-hl-show-hunk-inline--height))
127137
" "
128-
""))
138+
(string ?\s (cdr diff-hl-show-hunk-inline-scroll-indicators) ?\s)))
129139
(footer (or footer ""))
130140
(new-width (- width (length footer) (length scroll-indicator)))
131141
(footer (if (< new-width 0) "" footer))

0 commit comments

Comments
 (0)