emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/diff-hl b5651f1c57 3/3: diff-hl-flydiff-mode: Always ca


From: ELPA Syncer
Subject: [elpa] externals/diff-hl b5651f1c57 3/3: diff-hl-flydiff-mode: Always cancel the timer if it exists
Date: Mon, 7 Aug 2023 12:57:41 -0400 (EDT)

branch: externals/diff-hl
commit b5651f1c57b42e0f38e01a8fc8c7df9bc76d5d38
Author: Dmitry Gutov <dmitry@gutov.dev>
Commit: Dmitry Gutov <dmitry@gutov.dev>

    diff-hl-flydiff-mode: Always cancel the timer if it exists
    
    Fixes #202
---
 diff-hl-flydiff.el | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/diff-hl-flydiff.el b/diff-hl-flydiff.el
index bb3d47748b..e366eecc4e 100644
--- a/diff-hl-flydiff.el
+++ b/diff-hl-flydiff.el
@@ -61,6 +61,9 @@
   "Perform highlighting on-the-fly.
 This is a global minor mode.  It alters how `diff-hl-mode' works."
   :lighter "" :global t
+  (and diff-hl-flydiff-timer
+       (cancel-timer diff-hl-flydiff-timer))
+
   (if diff-hl-flydiff-mode
       (progn
         (advice-add 'diff-hl-overlay-modified :override #'ignore)
@@ -75,9 +78,6 @@ This is a global minor mode.  It alters how `diff-hl-mode' 
works."
     (advice-remove 'diff-hl-overlay-modified #'ignore)
 
     (advice-remove 'diff-hl-modified-p #'diff-hl-flydiff/modified-p)
-    (advice-remove 'diff-hl-changes-buffer #'diff-hl-flydiff-changes-buffer)
-
-    (and diff-hl-flydiff-timer
-         (cancel-timer diff-hl-flydiff-timer))))
+    (advice-remove 'diff-hl-changes-buffer #'diff-hl-flydiff-changes-buffer)))
 
 (provide 'diff-hl-flydiff)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]