branch: externals/diff-hl
commit 3eefe68941933c8549049502007411ed2bf70387
Merge: e79aa49ad3 82693fa09c
Author: Dmitry Gutov <[email protected]>
Commit: GitHub <[email protected]>
Merge pull request #269 from prashantvithani/master
fix: Handle cons cell value for line-spacing
---
diff-hl.el | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/diff-hl.el b/diff-hl.el
index 6f3f1377e6..9b628a4bab 100644
--- a/diff-hl.el
+++ b/diff-hl.el
@@ -315,10 +315,13 @@ It can be a relative expression as well, such as
\"HEAD^\" with Git, or
(expt text-scale-mode-step text-scale-mode-amount)
1))
(spacing (or (and (display-graphic-p) (default-value 'line-spacing))
0))
+ (total-spacing (pcase spacing
+ ((pred numberp) spacing)
+ (`(,above . ,below) (+ above below))))
(h (+ (ceiling (* (frame-char-height) scale))
- (if (floatp spacing)
- (truncate (* (frame-char-height) spacing))
- spacing)))
+ (if (floatp total-spacing)
+ (truncate (* (frame-char-height) total-spacing))
+ total-spacing)))
(w (min (frame-parameter nil (intern (format "%s-fringe"
diff-hl-side)))
diff-hl-bmp-max-width))
(_ (when (zerop w) (setq w diff-hl-bmp-max-width)))