fix(vc-gutter): remove advice removal for diff-hl-overlay-modified

Originally, this intended to *stop* diff-hl from too aggressively
deleting the diff overlays while editing. This is either no longer the
case or the old advice was mistaken; the intended behavior is achieved
without it.
This commit is contained in:
Henrik Lissner 2022-08-09 17:54:43 +02:00
parent d55d7f3088
commit 99b0b70c49
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -203,14 +203,12 @@ is deferred until the file is saved. Respects `git-gutter:disabled-modes'."
(apply fn args)))
;; UX: Don't delete the current hunk's indicators while we're editing
(when (featurep! :editor evil)
(add-hook! 'diff-hl-flydiff-mode-hook
(defun +vc-gutter-init-flydiff-mode-h ()
(if diff-hl-flydiff-mode
(progn
(advice-remove #'diff-hl-overlay-modified #'ignore)
(when (featurep! :editor evil)
(add-hook 'evil-insert-state-exit-hook #'diff-hl-flydiff-update)))
(remove-hook 'evil-insert-state-exit-hook #'diff-hl-flydiff-update))))
(if (not diff-hl-flydiff-mode)
(remove-hook 'evil-insert-state-exit-hook #'diff-hl-flydiff-update)
(add-hook 'evil-insert-state-exit-hook #'diff-hl-flydiff-update)))))
;; FIX: Reverting a hunk causes the cursor to be moved to an unexpected place,
;; often far from the target hunk.