]> code.delx.au - gnu-emacs-elpa/blobdiff - packages/diff-hl/diff-hl-flydiff.el
Merge commit 'e93367512080e540dc5dd126dfcb38b4a5e9415b' from diff-hl
[gnu-emacs-elpa] / packages / diff-hl / diff-hl-flydiff.el
index 94dbbd7f6d9e89f68536d9a37ccd86884d18e3b3..7f0c6c7de03f41aa0c624bd09dc5f2c2afc6fff1 100644 (file)
@@ -39,7 +39,7 @@
   :type 'number)
 
 (defvar diff-hl-flydiff-modified-tick 0)
-(defvar diff-hl-flydiff-timer)
+(defvar diff-hl-flydiff-timer nil)
 (make-variable-buffer-local 'diff-hl-flydiff-modified-tick)
 
 (defun diff-hl-flydiff/vc-git--symbolic-ref (file)
@@ -167,6 +167,7 @@ This requires the external program `diff' to be in your `exec-path'."
     (advice-remove 'diff-hl-modified-p #'diff-hl-flydiff/modified-p)
     (advice-remove 'diff-hl-changes-buffer #'diff-hl-flydiff-buffer-with-head)
 
-    (cancel-timer diff-hl-flydiff-timer)))
+    (and diff-hl-flydiff-timer
+         (cancel-timer diff-hl-flydiff-timer))))
 
 (provide 'diff-hl-flydiff)