Skip to content

Commit 4c9cfcb

Browse files
author
Jason Duncan
committed
Improved the newline situation.
1 parent 57bb6a6 commit 4c9cfcb

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

dashboard-project-status.el

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -57,26 +57,25 @@
5757
(abbreviate-file-name git-repo))
5858
(dashboard-insert-heading git-repo))
5959
(dashboard-insert-heading
60-
(concat
61-
(if (dashboard-project-status-git-local-is-behind?)
62-
" is behind the remote. (use \"git pull\" to update)"
63-
" is up-to-date.")
64-
hard-newline)))
60+
(if (dashboard-project-status-git-local-is-behind?)
61+
" is behind the remote. (use \"git pull\" to update)"
62+
" is up-to-date.")))
6563

6664
(defun dashboard-project-status-insert-body ()
6765
"Insert lists of untracked, unstaged, and staged files."
6866
(dolist (section `(("Untracked Files:" . ,(git-untracked-files))
6967
("Unstaged Files:" . ,(dashboard-project-status-git-unstaged-files))
7068
("Staged Files:" . ,(git-staged-files))))
71-
(dashboard-insert-recentf-list
72-
(car section)
73-
(reverse
74-
(let (ret)
75-
(dolist (cur (cdr section) ret)
76-
(setq ret (cons (expand-file-name
77-
(concat (file-name-as-directory git-repo) cur))
78-
ret))))))
79-
(insert hard-newline)))
69+
(when (cdr section)
70+
(insert hard-newline)
71+
(dashboard-insert-recentf-list
72+
(car section)
73+
(reverse
74+
(let (ret)
75+
(dolist (cur (cdr section) ret)
76+
(setq ret (cons (expand-file-name
77+
(concat (file-name-as-directory git-repo) cur))
78+
ret)))))))))
8079

8180
(defun dashboard-project-status (project-dir &optional update)
8281
"Return a function which will insert git status for PROJECT-DIR.

0 commit comments

Comments
 (0)