branch: elpa/magit
commit 6c4c16942ab2f6a12b4670508ba7f8b9df541020
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>
Require empty region for single-section selection
Provided single-section selection is enabled, the selection
still becomes immediately active and visualized after invoking
`set-mark-command' on a heading. However when then moving within
that line, as opposed to the heading of another heading, then the
selection is now deactivated.
That way the region overlay is not obscured when moving within a
single heading to select some text.
---
lisp/magit-section.el | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lisp/magit-section.el b/lisp/magit-section.el
index 37e17eb1575..c61e77f0a32 100644
--- a/lisp/magit-section.el
+++ b/lisp/magit-section.el
@@ -2087,7 +2087,9 @@ forms CONDITION can take."
(send (magit-section-at rend)))
(and send
(not (eq send magit-root-section))
- (not (and multiple (eq send sbeg)))
+ (not (and (eq send sbeg)
+ (or multiple
+ (> rend rbeg))))
(let ((siblings (cons sbeg (magit-section-siblings sbeg 'next)))
(sections ()))
(and (memq send siblings)