aboutsummaryrefslogtreecommitdiff
path: root/lisp/magit-git.el
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2025-02-20 00:20:34 +0100
committerJonas Bernoulli <jonas@bernoul.li>2025-02-20 00:20:34 +0100
commit2b3f2cb9addc3192d26e955177d1d39dde0cdf08 (patch)
treebde0cb0dc357df77c015e1ea337d161d42cba3d9 /lisp/magit-git.el
parent12e1f3838cd6879fa79f5548eba5e80ad19d94f9 (diff)
magit-thingatpt--git-revision: Only recognize painted references
In [1: a07b46fbe3] we started to ignore text that matches the name of a reference but is propertized using a face that does not appear in `magit-revision-faces', but if the text is not propertized, then we continued to treated it as a revision or reference. Now we insist on the use of a revision or reference face. Users who want to revert to the old behavior can add nil to `magit-revision-faces'. Closes #4115. 1: 2022-06-03 a07b46fbe3bf3f4737be812c4bd42a85db012a9a magit-thingatpt--git-revision: Avoid some false-positives
Diffstat (limited to 'lisp/magit-git.el')
-rw-r--r--lisp/magit-git.el5
1 files changed, 2 insertions, 3 deletions
diff --git a/lisp/magit-git.el b/lisp/magit-git.el
index a7c37af..d1cf573 100644
--- a/lisp/magit-git.el
+++ b/lisp/magit-git.el
@@ -2529,9 +2529,8 @@ and this option only controls what face is used.")
(string-match-p "[a-z]" string)
(magit-commit-p string))
(and (magit-ref-p string)
- (let ((face (get-text-property (point) 'face)))
- (or (not face)
- (member face magit-revision-faces)))))
+ (member (get-text-property (point) 'face)
+ magit-revision-faces)))
string)))))
(put 'git-revision-range 'thing-at-point #'magit-thingatpt--git-revision-range)