]> code.delx.au - gnu-emacs-elpa/blobdiff - diff-hl-flydiff.el
No need to remove diff-hl-edit from hooks
[gnu-emacs-elpa] / diff-hl-flydiff.el
index 4cd2bad5fb1a729c63dc3c64580089d88078766f..d3b5c0147ff72852c1321f3063ff2c06ba1355ce 100644 (file)
@@ -26,6 +26,7 @@
 ;;; Code:
 
 (require 'diff-hl)
+(require 'nadvice)
 
 (defvar diff-hl-flydiff-modified-tick 0)
 (defvar diff-hl-flydiff-timer)
@@ -177,12 +178,10 @@ This requires the external program `diff' to be in your `exec-path'."
   :global t
   (if diff-hl-flydiff-mode
     (progn
-      (require 'nadvice)
       (advice-add 'diff-hl-update :around #'diff-hl-flydiff/update)
       (advice-add 'diff-hl-changes :override #'diff-hl-flydiff/changes)
       (advice-add 'diff-hl-overlay-modified :override #'ignored)
 
-      (remove-hook 'after-change-functions #'diff-hl-edit t)
       (setq diff-hl-flydiff-timer
         (run-with-idle-timer 0.3 t #'diff-hl-update t)))
 
@@ -190,8 +189,6 @@ This requires the external program `diff' to be in your `exec-path'."
     (advice-remove 'diff-hl-changes #'diff-hl-flydiff/changes)
     (advice-remove 'diff-hl-overlay-modified #'ignored)
 
-    (cancel-timer diff-hl-flydiff-timer)
-    (when diff-hl-mode
-      (add-hook 'after-change-functions 'diff-hl-edit nil t))))
+    (cancel-timer diff-hl-flydiff-timer)))
 
 (provide 'diff-hl-flydiff)