Variable: magit-keep-region-overlay

magit-keep-region-overlay is an alias and customizable for magit-section-keep-region-overlay, defined in magit-section.el.

This variable is obsolete since Magit-Section 4.0.0; use magit-section-keep-region-overlay instead.

Value

nil

Documentation

Whether to keep the region overlay when there is a valid selection.

We strongly suggest that you keep the default value, nil.

By default Magit removes the regular region overlay if, and only if, that region constitutes a valid selection as understood by Magit commands. Otherwise it does not remove that overlay, and the region looks like it would in other buffers.

There are two types of such valid selections: hunk-internal regions and regions that select two or more sibling sections. In such cases Magit removes the region overlay and instead highlights a slightly larger range. All text (for hunk-internal regions) or the headings of all sections (for sibling selections) that are inside that range (not just inside the region) are acted on by commands such as the staging command. This buffer range begins at the beginning of the line on which the region begins and ends at the end of the line on which the region ends.

Because Magit acts on this larger range and not the region, it is actually quite important to visualize that larger range. If we don't do that, then one might think that these commands act on the region instead. If you want to *also* visualize the region, then set this option to t. But please note that when the region does *not* constitute a valid selection, then the region is
*always* visualized as usual, and that it is usually under such
circumstances that you want to use a non-magit command to act on the region.

Depending on the used theme, the magit-*-highlight-selection faces might conflict with the region face. If that happens and it bothers you, then you have to customize these faces to address the conflicts.

Aliases

magit-keep-region-overlay (obsolete since Magit-Section 4.0.0)