-;; Copyright (C) 2015 Free Software Foundation, Inc.
+;; Copyright (C) 2015, 2016 Free Software Foundation, Inc.
;; Author: Jonathan Hayase <PythonNut@gmail.com>
;; URL: https://github.com/dgutov/diff-hl
: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)
(defun diff-hl-flydiff-update ()
(unless (or
+ (not diff-hl-mode)
(= diff-hl-flydiff-modified-tick (buffer-modified-tick))
(file-remote-p default-directory))
(diff-hl-update)))
(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)