branch: master
commit f8ce39d157144ee4b22d386dd40673ea7f87ecd7
Author: Dmitry Gutov <[email protected]>
Commit: Dmitry Gutov <[email protected]>

    Solve the "cloned indirect buffer" problem
    
    
https://github.com/dgutov/diff-hl/commit/fdbf34a93d6b249ba20d9e7501dfa026aa88ac04#commitcomment-18802844
---
 diff-hl.el | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/diff-hl.el b/diff-hl.el
index 6650818..d60fce6 100644
--- a/diff-hl.el
+++ b/diff-hl.el
@@ -538,6 +538,10 @@ in the source file, or the last line of the hunk above it."
     (dolist (buf (buffer-list))
       (when (and (buffer-local-value 'diff-hl-mode buf)
                  (not (buffer-modified-p buf))
+                 ;; Solve the "cloned indirect buffer" problem
+                 ;; (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))
         (with-current-buffer buf
           (let* ((file buffer-file-name)

Reply via email to