fix(version-control): pin diff-hl to a known good commit

The very next commit introduces a new feature to show git hunks, which
seems to have a negative impact on performance when moving the cursor
around, or adding/removing text within lines which are highlighted by
diff-hl while diff-hl-flydiff-mode is enabled.

So for now I'm pinning diff-hl to the commit right before this was
introduced.
This commit is contained in:
2021-04-01 01:07:33 +01:00
parent 009c3dc4b1
commit 5a425b5812
4 changed files with 67 additions and 53 deletions

View File

@@ -8,70 +8,74 @@
(require 'siren-magit)
(use-package diff-hl
:hook
(prog-mode . siren-turn-on-diff-hl-mode)
(text-mode . siren-turn-on-diff-hl-mode)
(dired-mode . diff-hl-dired-mode)
(magit-pre-refresh . diff-hl-magit-pre-refresh)
(magit-post-refresh . diff-hl-magit-post-refresh)
(let ((straight-current-profile 'pinned))
(straight-x-pin-package
"diff-hl" "4c46b3b9851c85d15bff1e3ec92e5fc6043322bc")
: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-fringe-bmp-function 'diff-hl-fringe-bmp-from-pos)
(diff-hl-fringe-face-function 'diff-hl-fringe-face-from-type)
(use-package diff-hl
:hook
(prog-mode . siren-turn-on-diff-hl-mode)
(text-mode . siren-turn-on-diff-hl-mode)
(dired-mode . diff-hl-dired-mode)
(magit-pre-refresh . diff-hl-magit-pre-refresh)
(magit-post-refresh . diff-hl-magit-post-refresh)
(diff-hl-margin-symbols-alist
'((insert . "+")
(delete . "-")
(change . "=")
(unknown . "?")
(ignored . "i")))
: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-fringe-bmp-function 'diff-hl-fringe-bmp-from-pos)
(diff-hl-fringe-face-function 'diff-hl-fringe-face-from-type)
:init
(defun siren-turn-on-diff-hl-mode ()
(turn-on-diff-hl-mode)
(diff-hl-flydiff-mode 1))
(diff-hl-margin-symbols-alist
'((insert . "+")
(delete . "-")
(change . "=")
(unknown . "?")
(ignored . "i")))
(defgroup siren-diff-hl nil
"Siren specific tweaks to diff-hl.")
:init
(defun siren-turn-on-diff-hl-mode ()
(turn-on-diff-hl-mode)
(diff-hl-flydiff-mode 1))
(defface siren-diff-hl-insert
'((default :inherit diff-hl-insert))
"Face used to highlight inserted lines."
:group 'siren-diff-hl)
(defgroup siren-diff-hl nil
"Siren specific tweaks to 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-insert
'((default :inherit diff-hl-insert))
"Face used to highlight inserted 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)
(defface siren-diff-hl-delete
'((default :inherit diff-hl-delete))
"Face used to highlight deleted lines."
:group 'siren-diff-hl)
(defun siren-diff-hl-fringe-face-from-type (type _pos)
(intern (format "siren-diff-hl-%s" type)))
(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-bmp-from-type(type _pos)
(intern (format "siren-diff-hl-%s" type)))
(defun siren-diff-hl-fringe-face-from-type (type _pos)
(intern (format "siren-diff-hl-%s" type)))
(defun siren-diff-hl-fringe-bmp-line(type _pos)
'siren-diff-hl-insert)
(defun siren-diff-hl-fringe-bmp-from-type(type _pos)
(intern (format "siren-diff-hl-%s" type)))
:config
(if (not (window-system))
(diff-hl-margin-mode 1))
(defun siren-diff-hl-fringe-bmp-line(type _pos)
'siren-diff-hl-insert)
;; 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))
:config
(if (not (window-system))
(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