Next: , Previous: , Up: Diffing   [Contents][Index]

5.4.3 Diff Options

User Option: magit-diff-refine-hunk

Whether to show word-granularity differences within diff hunks.

User Option: magit-diff-refine-ignore-whitespace

Whether to ignore whitespace changes in word-granularity differences.

User Option: magit-diff-adjust-tab-width

Whether to adjust the width of tabs in diffs.

Determining the correct width can be expensive if it requires opening large and/or many files, so the widths are cached in the variable magit-diff--tab-width-cache. Set that to nil to invalidate the cache.

User Option: magit-diff-paint-whitespace

Specify where to highlight whitespace errors.

See magit-diff-highlight-trailing, magit-diff-highlight-indentation. The symbol t means in all diffs, status means only in the status buffer, and nil means nowhere.

User Option: magit-diff-paint-whitespace-lines

Specify in what kind of lines to highlight whitespace errors.

User Option: magit-diff-highlight-trailing

Whether to highlight whitespace at the end of a line in diffs. Used only when magit-diff-paint-whitespace is non-nil.

User Option: magit-diff-highlight-indentation

Highlight the "wrong" indentation style. Used only when magit-diff-paint-whitespace is non-nil.

The value is a list of cons cells. The car is a regular expression, and the cdr is the value that applies to repositories whose directory matches the regular expression. If more than one element matches, then the last element in the list applies. The default value should therefore come first in the list.

If the value is tabs, highlight indentation with tabs. If the value is an integer, highlight indentation with at least that many spaces. Otherwise, highlight neither.

User Option: magit-diff-hide-trailing-cr-characters

Whether to hide ^M characters at the end of a line in diffs.

User Option: magit-diff-highlight-hunk-region-functions

This option specifies the functions used to highlight the hunk-internal region.

magit-diff-highlight-hunk-region-dim-outside overlays the outside of the hunk internal selection with a face that causes the added and removed lines to have the same background color as context lines. This function should not be removed from the value of this option.

magit-diff-highlight-hunk-region-using-overlays and magit-diff-highlight-hunk-region-using-underline emphasize the region by placing delimiting horizontal lines before and after it. Both of these functions have glitches which cannot be fixed due to limitations of Emacs’ display engine. For more information see ff.

Instead of, or in addition to, using delimiting horizontal lines, to emphasize the boundaries, you may which to emphasize the text itself, using magit-diff-highlight-hunk-region-using-face.

In terminal frames it’s not possible to draw lines as the overlay and underline variants normally do, so there they fall back to calling the face function instead.

User Option: magit-diff-unmarked-lines-keep-foreground

This option controls whether added and removed lines outside the hunk-internal region only lose their distinct background color or also the foreground color. Whether the outside of the region is dimmed at all depends on magit-diff-highlight-hunk-region-functions.

Next: , Previous: , Up: Diffing   [Contents][Index]