From 99b0b70c49fb8e937d34f3e11ab3a3b54140f8a6 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 9 Aug 2022 17:54:43 +0200 Subject: [PATCH] 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. --- modules/ui/vc-gutter/config.el | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/modules/ui/vc-gutter/config.el b/modules/ui/vc-gutter/config.el index 28fe5968d..d3d4948a4 100644 --- a/modules/ui/vc-gutter/config.el +++ b/modules/ui/vc-gutter/config.el @@ -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 - (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)))) + (when (featurep! :editor evil) + (add-hook! 'diff-hl-flydiff-mode-hook + (defun +vc-gutter-init-flydiff-mode-h () + (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.