Skip to content

Commit 3897c13

Browse files
author
Jason Duncan
committed
Now linking to magit when available.
1 parent cd36920 commit 3897c13

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

dashboard-project-status.el

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,23 @@
4343

4444
(defun dashboard-insert-project-status-heading ()
4545
"Insert a heading with project path and whether or not it is behind."
46+
(dashboard-insert-heading "Project ")
47+
(if (functionp 'magit-status)
48+
(widget-create 'push-button
49+
:action `(lambda (&rest ignore) (magit-status ,git-repo))
50+
:mouse-face 'highlight
51+
:follow-link "\C-m"
52+
:button-prefix ""
53+
:button-suffix ""
54+
:format "%[%t%]"
55+
(abbreviate-file-name git-repo))
56+
(dashboard-insert-heading git-repo))
4657
(dashboard-insert-heading
47-
(concat "Project "
48-
git-repo
49-
(if (git-local-is-behind?)
50-
" is behind the remote. (use \"git-pull\" to update)"
51-
" is up-to-date.")
52-
hard-newline)))
58+
(concat
59+
(if (git-local-is-behind?)
60+
" is behind the remote. (use \"git-pull\" to update)"
61+
" is up-to-date.")
62+
hard-newline)))
5363

5464
(defun dashboard-insert-project-status-body ()
5565
"Insert lists of untracked, unstaged, and staged files."

0 commit comments

Comments
 (0)