Function: magit-diff-toggle-refine-hunk
magit-diff-toggle-refine-hunk is an interactive and byte-compiled
function defined in magit-diff.el.
Signature
(magit-diff-toggle-refine-hunk &optional STYLE)
Documentation
Turn hunk refinement on or off, or switch refinement method.
If hunk refinement is currently on, then turn off hunk refinement. If hunk refinement is off, then turn on immediate hunk refinement.
With a prefix argument, an alternative refinement 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 refinement is currently on, then toggle between refining all hunks up front or only once they are selected. If hunk refinement is off, then turn on hunk refinement, using the eventual refinement method.
Customize option magit-diff-refine-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-refine-hunk (&optional style)
"Turn hunk refinement on or off, or switch refinement method.
If hunk refinement is currently on, then turn off hunk refinement.
If hunk refinement is off, then turn on immediate hunk refinement.
With a prefix argument, an alternative refinement 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 refinement is currently
on, then toggle between refining all hunks up front or only once they
are selected. If hunk refinement is off, then turn on hunk refinement,
using the eventual refinement method.
Customize option `magit-diff-refine-hunk' to change the default method."
(interactive "P")
(setq-local magit-diff-refine-hunk
(if style
(if (eq magit-diff-refine-hunk t) 'all t)
(if magit-diff-refine-hunk nil 'all)))
(magit-diff-update-hunk-refinement))