@@ -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+ " Strings 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. Each string includes any surrounding padding."
81+ :type '(cons (string :tag " Above" )
82+ (string :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
@@ -112,7 +119,11 @@ Compute it from LINES starting at INDEX with a WINDOW-SIZE."
112119(defun diff-hl-show-hunk-inline--compute-header (width &optional header )
113120 " Compute the header of the popup.
114121Compute it from some WIDTH, and some optional HEADER text."
115- (let* ((scroll-indicator (if (eq diff-hl-show-hunk-inline--current-index 0 ) " " " ⬆ " ))
122+ (let* ((above-indicator (car diff-hl-show-hunk-inline-scroll-indicators))
123+ (scroll-indicator
124+ (if (eq diff-hl-show-hunk-inline--current-index 0 )
125+ (make-string (length above-indicator) ?\s )
126+ above-indicator))
116127 (header (or header " " ))
117128 (new-width (- width (length header) (length scroll-indicator)))
118129 (header (if (< new-width 0 ) " " header))
@@ -125,11 +136,13 @@ Compute it from some WIDTH, and some optional HEADER text."
125136(defun diff-hl-show-hunk-inline--compute-footer (width &optional footer )
126137 " Compute the header of the popup.
127138Compute it from some WIDTH, and some optional FOOTER text."
128- (let* ((scroll-indicator (if (>= diff-hl-show-hunk-inline--current-index
129- (- (length diff-hl-show-hunk-inline--current-lines)
130- diff-hl-show-hunk-inline--height))
131- " "
132- " ⬇ " ))
139+ (let* ((below-indicator (cdr diff-hl-show-hunk-inline-scroll-indicators))
140+ (scroll-indicator
141+ (if (>= diff-hl-show-hunk-inline--current-index
142+ (- (length diff-hl-show-hunk-inline--current-lines)
143+ diff-hl-show-hunk-inline--height))
144+ (make-string (length below-indicator) ?\s )
145+ below-indicator))
133146 (footer (or footer " " ))
134147 (new-width (- width (length footer) (length scroll-indicator)))
135148 (footer (if (< new-width 0 ) " " footer))
0 commit comments