]> code.delx.au - gnu-emacs-elpa/commitdiff
Don't error out when fringe is disabled
authorDmitry Gutov <dgutov@yandex.ru>
Fri, 12 Dec 2014 18:38:49 +0000 (20:38 +0200)
committerDmitry Gutov <dgutov@yandex.ru>
Fri, 12 Dec 2014 18:40:52 +0000 (20:40 +0200)
Fixes #20 (belatedly) and purcell/emacs.d#241

diff-hl.el

index 8f675a322ce2733f0ed41d9f33c2410b8e2a2d8e..1daab19130845f26d747eb670e255a4eb2b027ac 100644 (file)
     (define-fringe-bitmap 'diff-hl-bmp-bottom bottom h w 'bottom)\r
     (define-fringe-bitmap 'diff-hl-bmp-single single h w 'top)\r
     (let* ((w2 (* (/ w 2) 2))\r
+           ;; When fringes are disabled, it's easier to fix up the width,\r
+           ;; instead of doing nothing (#20).\r
+           (w2 (if (zerop w2) 2 w2))\r
            (delete-row (- (expt 2 (1- w2)) 2))\r
            (middle-pos (1- (/ w2 2)))\r
            (middle-bit (expt 2 middle-pos))\r