Skip to content

Commit f423692

Browse files
fix: Handle cons cell value for line-spacing
The `line-spacing` variable can be a [cons cell][1], such as `(0.1 . 0.1)`, in addition to a plain number. Each value in this cons is spacing above and below the line. The correct value of line-spacing would be to use [`total-line-spacing`][1] instead of raw value. The previous code did not handle the cons cell format, leading to a `wrong-type-argument` error. This change uses `total-line-spacing` instead. [1]: emacs-mirror/emacs@e8f26d5
1 parent e79aa49 commit f423692

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

diff-hl.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ It can be a relative expression as well, such as \"HEAD^\" with Git, or
314314
(numberp text-scale-mode-amount))
315315
(expt text-scale-mode-step text-scale-mode-amount)
316316
1))
317-
(spacing (or (and (display-graphic-p) (default-value 'line-spacing)) 0))
317+
(spacing (or (and (display-graphic-p) (total-line-spacing (default-value 'line-spacing))) 0))
318318
(h (+ (ceiling (* (frame-char-height) scale))
319319
(if (floatp spacing)
320320
(truncate (* (frame-char-height) spacing))

0 commit comments

Comments
 (0)