Skip to content

Commit f61c3ec

Browse files
committed
Fix update-on-idle in background buffers
1 parent f86322b commit f61c3ec

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

diff-hl.el

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,10 @@ contents as they are (or would be) after applying the changes in NEW."
644644
"diff-hl--update-safe")))
645645
(diff-hl--update)))
646646

647+
(defun diff-hl--update-buffer (buf)
648+
(with-current-buffer buf
649+
(diff-hl-update)))
650+
647651
(defun diff-hl-with-editor-p (_dir)
648652
(bound-and-true-p with-editor-mode))
649653

@@ -745,7 +749,7 @@ Return a list of line overlays used."
745749
;; That will keep the the local value of <side>-margin-width, if any.
746750
(unless diff-hl-timer
747751
(setq diff-hl-timer
748-
(run-with-idle-timer 0 nil #'diff-hl-update))))
752+
(run-with-idle-timer 0 nil #'diff-hl--update-buffer (current-buffer)))))
749753

750754
(defun diff-hl-add-highlighting (type shape &optional ovl)
751755
(let ((o (or ovl (make-overlay (point) (point)))))

0 commit comments

Comments
 (0)