diff --git a/modules/themes/siren-doom-themes.el b/modules/themes/siren-doom-themes.el index 60feb8e..60afb9e 100644 --- a/modules/themes/siren-doom-themes.el +++ b/modules/themes/siren-doom-themes.el @@ -88,7 +88,28 @@ :background (doom-blend 'vc-deleted 'bg 0.2)) (set-face-attribute 'diff-hl-change nil :foreground (doom-blend 'vc-modified 'bg 0.7) - :background (doom-blend 'vc-modified 'bg 0.2))) + :background (doom-blend 'vc-modified 'bg 0.2)) + + (set-face-attribute 'siren-diff-hl-insert nil + :foreground (doom-blend 'vc-added 'bg 0.6) + :background (doom-color 'bg)) + (set-face-attribute 'siren-diff-hl-delete nil + :foreground (doom-blend 'vc-deleted 'bg 0.65) + :background (doom-color 'bg)) + (set-face-attribute 'siren-diff-hl-change nil + :foreground (doom-blend 'vc-modified 'bg 0.5) + :background (doom-color 'bg))) + + (with-eval-after-load 'diff-hl-margin + (set-face-attribute 'diff-hl-margin-insert nil + :foreground (doom-blend 'vc-added 'bg 0.6) + :background (doom-blend 'vc-added 'bg 0.1)) + (set-face-attribute 'diff-hl-margin-delete nil + :foreground (doom-blend 'vc-deleted 'bg 0.7) + :background (doom-blend 'vc-deleted 'bg 0.1)) + (set-face-attribute 'diff-hl-margin-change nil + :foreground (doom-blend 'vc-modified 'bg 0.5) + :background (doom-blend 'vc-modified 'bg 0.1))) (with-eval-after-load 'diff-hl-margin (set-face-attribute 'diff-hl-margin-insert nil diff --git a/modules/version-control/siren-diff-hl.el b/modules/version-control/siren-diff-hl.el index 4f13969..6380d56 100644 --- a/modules/version-control/siren-diff-hl.el +++ b/modules/version-control/siren-diff-hl.el @@ -15,14 +15,59 @@ (dired-mode . diff-hl-dired-mode) (magit-post-refresh . diff-hl-magit-post-refresh) + :custom + (diff-hl-fringe-bmp-function 'siren-diff-hl-fringe-bmp-line) + (diff-hl-fringe-face-function 'siren-diff-hl-fringe-face-from-type) + (diff-hl-margin-symbols-alist + '((insert . "+") + (delete . "-") + (change . "=") + (unknown . "?") + (ignored . "i"))) + :init (defun siren-turn-on-diff-hl-mode () (turn-on-diff-hl-mode) (diff-hl-flydiff-mode 1)) + (defgroup siren-diff-hl nil + "Siren specific tweaks to diff-hl.") + + (defface siren-diff-hl-insert + '((default :inherit diff-hl-insert)) + "Face used to highlight inserted lines." + :group 'siren-diff-hl) + + (defface siren-diff-hl-delete + '((default :inherit diff-hl-delete)) + "Face used to highlight deleted lines." + :group 'siren-diff-hl) + + (defface siren-diff-hl-change + '((default :inherit diff-hl-change)) + "Face used to highlight changed lines." + :group 'siren-diff-hl) + + (defun siren-diff-hl-fringe-face-from-type (type _pos) + (intern (format "siren-diff-hl-%s" type))) + + (defun siren-diff-hl-fringe-bmp-from-type(type _pos) + (intern (format "siren-diff-hl-%s" type))) + + (defun siren-diff-hl-fringe-bmp-line(type _pos) + 'siren-diff-hl-insert) + :config (if (not (window-system)) - (diff-hl-margin-mode 1))) + (diff-hl-margin-mode 1)) + + ;; Fringe bitmaps borrowed from doom-emacs' ui/vc-gutter module + (define-fringe-bitmap 'siren-diff-hl-insert + [224] nil nil '(center repeated)) + (define-fringe-bitmap 'siren-diff-hl-change + [224] nil nil '(center repeated)) + (define-fringe-bitmap 'siren-diff-hl-delete + [128 192 224 240] nil nil 'bottom)) (provide 'siren-diff-hl) ;;; siren-diff-hl.el ends here