branch: elpa/magit
commit 3c9e519197931ab491ff72e0a12da64f6c923fa6
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>
magit-mouse-set-point: New command
---
lisp/magit-section.el | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/lisp/magit-section.el b/lisp/magit-section.el
index 1ebe94ffb1b..355356442ea 100644
--- a/lisp/magit-section.el
+++ b/lisp/magit-section.el
@@ -858,6 +858,12 @@ If there is no previous sibling section, then move to the
parent."
(magit-section-backward))
(magit-section-goto -1))))
+(defun magit-mouse-set-point (event &optional promote-to-region)
+ "Like `mouse-set-point' but also call `magit-section-movement-hook'."
+ (interactive "e\np")
+ (mouse-set-point event promote-to-region)
+ (run-hook-with-args 'magit-section-movement-hook (magit-current-section)))
+
(defun magit-section-goto (arg)
(if (integerp arg)
(progn (forward-line arg)