Skip to content

Commit 376606a

Browse files
committed
Disables track-changes-mode inside the temporary diff-hl-revert buffer.
This prevents asynchronous background timers from firing while execution is suspended at the yes-or-no-p prompt. Because the buffer is narrowed to highlight the hunk, the tracker previously attempted to access coordinates outside the visible region, causing an assertion failure.
1 parent 81b7628 commit 376606a

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

diff-hl.el

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,12 +1035,14 @@ that file, if it's present."
10351035
(progn
10361036
(vc-setup-buffer diff-buffer)
10371037
(with-current-buffer buffer
1038-
;; Ensure that the buffer-local variable value is applied.
10391038
(diff-hl-diff-against-reference file backend diff-buffer))
1040-
(diff-mode)
1041-
(setq-local diff-vc-backend backend)
1042-
(setq-local diff-vc-revisions (list diff-hl-reference-revision nil))
1043-
(setq buffer-read-only t)
1039+
(with-current-buffer diff-buffer
1040+
;; Prevent diff-mode from registering track-changes for this temp buffer
1041+
(cl-letf (((symbol-function 'track-changes-register) #'ignore))
1042+
(diff-mode))
1043+
(setq-local diff-vc-backend backend)
1044+
(setq-local diff-vc-revisions (list diff-hl-reference-revision nil))
1045+
(setq buffer-read-only t))
10441046
(pop-to-buffer diff-buffer)
10451047
(vc-run-delayed
10461048
(vc-diff-finish diff-buffer nil)

0 commit comments

Comments
 (0)