Skip to content

Commit f7953a0

Browse files
committed
diff-mode: Optimize source language syntax highlighting
* lisp/vc/diff-mode.el (diff--get-revision-properties): Never pass FILE to 'diff-syntax-fontify-props'; assume that 'vc-find-revision-no-save' has called the major mode function already (bug#71604).
1 parent b26270a commit f7953a0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lisp/vc/diff-mode.el

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2883,9 +2883,6 @@ and the position in MAX."
28832883
(buffer (cdr entry)))
28842884
(if (buffer-live-p buffer)
28852885
(progn
2886-
;; Don't re-initialize the buffer (which would throw
2887-
;; away the previous fontification work).
2888-
(setq file nil)
28892886
(setq diff--cached-revision-buffers
28902887
(cons entry
28912888
(delq entry diff--cached-revision-buffers))))
@@ -2905,7 +2902,8 @@ and the position in MAX."
29052902
(diff--cache-schedule-clean)
29062903
(and buffer
29072904
(with-current-buffer buffer
2908-
(diff-syntax-fontify-props file text line-nb)))))
2905+
;; Major mode is set in vc-find-revision-no-save already.
2906+
(diff-syntax-fontify-props nil text line-nb)))))
29092907

29102908
(defun diff-syntax-fontify-hunk (beg end old)
29112909
"Highlight source language syntax in diff hunk between BEG and END.

0 commit comments

Comments
 (0)