[Top][All Lists]

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

[elpa] master 9ef21e4 15/25: Merge pull request #93 from Wilfred/handle_

From: Dmitry Gutov
Subject: [elpa] master 9ef21e4 15/25: Merge pull request #93 from Wilfred/handle_file_move
Date: Sat, 8 Dec 2018 19:19:39 -0500 (EST)

branch: master
commit 9ef21e4ea2389545417741e20a89d92bfd72d6ff
Merge: bec9889 f0b945a
Author: Dmitry Gutov <address@hidden>
Commit: GitHub <address@hidden>

    Merge pull request #93 from Wilfred/handle_file_move
    Don't attempt to highlight in a file that doesn't exist
 diff-hl-flydiff.el | 1 +
 diff-hl.el         | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/diff-hl-flydiff.el b/diff-hl-flydiff.el
index 627840e..5b1522c 100644
--- a/diff-hl-flydiff.el
+++ b/diff-hl-flydiff.el
@@ -140,6 +140,7 @@ This requires the external program `diff' to be in your 
   (unless (or
            (not diff-hl-mode)
            (= diff-hl-flydiff-modified-tick (buffer-modified-tick))
+           (not (file-exists-p (buffer-file-name)))
            (file-remote-p default-directory))
diff --git a/diff-hl.el b/diff-hl.el
index d882eb1..86d9cc6 100644
--- a/diff-hl.el
+++ b/diff-hl.el
@@ -549,7 +549,8 @@ The value of this variable is a mode line template as in
                  ;; (diff-hl-mode could be non-nil there, even if
                  ;; buffer-file-name is nil):
                  (buffer-file-name buf)
-                 (file-in-directory-p (buffer-file-name buf) topdir))
+                 (file-in-directory-p (buffer-file-name buf) topdir)
+                 (file-exists-p (buffer-file-name buf)))
         (with-current-buffer buf
           (let* ((file buffer-file-name)
                  (backend (vc-backend file)))

reply via email to

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