Improve diff-hl fringe bitmap loading mechanism

This commit is contained in:
Jessie Hildebrandt 2022-12-19 19:20:19 -05:00
parent 090d87fdfb
commit 7ef249502d

View File

@ -27,7 +27,7 @@
;; (eval-after-load 'neotree #'adwaita-dark-theme-neotree-configuration-enable) ;; (eval-after-load 'neotree #'adwaita-dark-theme-neotree-configuration-enable)
;; ;;
;; To enable custom fringe bitmaps for `diff-hl': ;; To enable custom fringe bitmaps for `diff-hl':
;; (setq diff-hl-fringe-bmp-function #'adwaita-dark-theme-diff-hl-fringe-bmp-function) ;; (eval-after-load 'diff-hl #'adwaita-dark-theme-diff-hl-fringe-bmp-enable)
;; ;;
;; To enable custom fringe bitmaps for `flycheck': ;; To enable custom fringe bitmaps for `flycheck':
;; (eval-after-load 'flycheck #'adwaita-dark-theme-flycheck-fringe-bmp-enable) ;; (eval-after-load 'flycheck #'adwaita-dark-theme-flycheck-fringe-bmp-enable)
@ -922,18 +922,22 @@
(define-fringe-bitmap 'left-curly-arrow adwaita-dark-theme--empty-bmp)) (define-fringe-bitmap 'left-curly-arrow adwaita-dark-theme--empty-bmp))
;; diff-hl fringe bitmap ;; diff-hl fringe bitmap
(defvar adwaita-dark-theme--diff-hl-bmp (defconst adwaita-dark-theme--diff-hl-bmp
(define-fringe-bitmap 'adwaita-dark-theme--diff-hl-bmp (define-fringe-bitmap 'adwaita-dark-theme--diff-hl-bmp
(vector #b11100000) (vector #b11100000)
1 8 1 8
'(center t)) '(center t))
"Fringe bitmap for use with `diff-hl'.") "Fringe bitmap for use with `diff-hl'.")
;;;###autoload (defun adwaita-dark-theme--diff-hl-fringe-bmp-function (_type _pos)
(defun adwaita-dark-theme-diff-hl-fringe-bmp-function (_type _pos)
"Fringe bitmap function for use as `diff-hl-fringe-bmp-function'." "Fringe bitmap function for use as `diff-hl-fringe-bmp-function'."
adwaita-dark-theme--diff-hl-bmp) adwaita-dark-theme--diff-hl-bmp)
;;;###autoload
(defun adwaita-dark-theme-diff-hl-fringe-bmp-enable ()
"Enable custom adwaita-dark fringe bitmaps for use with flymake."
(setq diff-hl-fringe-bmp-function #'adwaita-dark-theme--diff-hl-fringe-bmp-function))
;; flycheck/flymake fringe bitmaps ;; flycheck/flymake fringe bitmaps
(define-fringe-bitmap 'adwaita-dark-theme--marker-bmp (define-fringe-bitmap 'adwaita-dark-theme--marker-bmp
(vector #b11100000 (vector #b11100000