Function: magit-diff-toggle-fontify-hunk
magit-diff-toggle-fontify-hunk is an interactive and byte-compiled
function defined in magit-diff.el.
Signature
(magit-diff-toggle-fontify-hunk &optional STYLE)
Documentation
Turn hunk fontification on or off, or switch fontification method.
If hunk fontification is currently on, then turn off hunk fontification. If hunk fontification is off, then turn on immediate hunk fontification.
With a prefix argument, an alternative fontification method comes into play. When using that method, mode hunks are not refined immediately, instead each hunk is refined once it is selected, and then stays refined until the next refresh of the buffer. If hunk fontification is currently on, then toggle between refining all hunks up front or only once they are selected. If hunk fontification is off, then turn on fontification, using the eventual fontification method.
Customize option magit-diff-fontify-hunk to change the default method.
Key Bindings
Source Code
;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-diff.el
(defun magit-diff-toggle-fontify-hunk (&optional style)
"Turn hunk fontification on or off, or switch fontification method.
If hunk fontification is currently on, then turn off hunk fontification.
If hunk fontification is off, then turn on immediate hunk fontification.
With a prefix argument, an alternative fontification method comes into
play. When using that method, mode hunks are not refined immediately,
instead each hunk is refined once it is selected, and then stays refined
until the next refresh of the buffer. If hunk fontification is currently
on, then toggle between refining all hunks up front or only once they
are selected. If hunk fontification is off, then turn on fontification,
using the eventual fontification method.
Customize option `magit-diff-fontify-hunk' to change the default method."
(interactive "P")
(setq-local magit-diff-fontify-hunk
(if style
(if (eq magit-diff-fontify-hunk t) 'all t)
(if magit-diff-fontify-hunk nil 'all)))
(magit-diff--update-hunk-syntax))