Put branch name in text properties.
This commit is contained in:
parent
b261669efe
commit
1ae36db891
1 changed files with 13 additions and 13 deletions
8
magit.el
8
magit.el
|
@ -3568,9 +3568,7 @@ Prefix arg means justify as well."
|
||||||
(defun magit--branch-name-from-line (line)
|
(defun magit--branch-name-from-line (line)
|
||||||
"Extract the branch name from one line of 'git branch' output.
|
"Extract the branch name from one line of 'git branch' output.
|
||||||
Will remove the 'remotes/' prefix if it exists."
|
Will remove the 'remotes/' prefix if it exists."
|
||||||
(save-match-data
|
(get-text-property 0 'branch-name line))
|
||||||
(if (string-match " \\([^ ]+\\)$" line)
|
|
||||||
(match-string 1 line))))
|
|
||||||
|
|
||||||
(defun magit--branch-name-at-point ()
|
(defun magit--branch-name-at-point ()
|
||||||
"Get the branch name in the line at point."
|
"Get the branch name in the line at point."
|
||||||
|
@ -3656,6 +3654,7 @@ With prefix force the removal even it it hasn't been merged."
|
||||||
(insert
|
(insert
|
||||||
(mapconcat
|
(mapconcat
|
||||||
(lambda (b)
|
(lambda (b)
|
||||||
|
(propertize
|
||||||
(concat
|
(concat
|
||||||
(cdr (assoc 'current b))
|
(cdr (assoc 'current b))
|
||||||
(propertize (or (cdr (assoc 'sha1 b))
|
(propertize (or (cdr (assoc 'sha1 b))
|
||||||
|
@ -3664,7 +3663,8 @@ With prefix force the removal even it it hasn't been merged."
|
||||||
" "
|
" "
|
||||||
(cdr (assoc 'branch b))
|
(cdr (assoc 'branch b))
|
||||||
(when (assoc 'other-ref b)
|
(when (assoc 'other-ref b)
|
||||||
(concat " (" (cdr (assoc 'other-ref b)) ")"))))
|
(concat " (" (cdr (assoc 'other-ref b)) ")")))
|
||||||
|
'branch-name (cdr (assoc 'branch b))))
|
||||||
branches
|
branches
|
||||||
"\n")))
|
"\n")))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue