Skip to content

Commit

Permalink
Change: Put newline in section headings
Browse files Browse the repository at this point in the history
Magit's own sections include the newline in the heading rather than
the body, and we should imitate them.

Closes #68.  Thanks to Sean Allred (@vermiculus).
  • Loading branch information
vermiculus authored and alphapapa committed May 8, 2019
1 parent c3bb703 commit 2d48f84
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 2 additions & 1 deletion README.org
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ Activate =magit-todos-mode=. Then open a Magit status buffer, or run ~magit-tod

*** 1.3-pre

Nothing new yet.
*Internal*
+ Put newline in section headings. ([[https://github.com/alphapapa/magit-todos/pull/68][#68]]. Thanks to [[https://github.com/vermiculus][Sean Allred]].)

*** 1.2

Expand Down
6 changes: 2 additions & 4 deletions magit-todos.el
Original file line number Diff line number Diff line change
Expand Up @@ -616,8 +616,7 @@ This function should be called from inside a ‘magit-status’ buffer."
(let ((magit-insert-section--parent magit-root-section))
(magit-insert-section (todos)
(magit-insert-heading (concat (propertize "TODOs" 'face 'magit-section-heading)
" (0)" reminder)))
(insert "\n")))
" (0)" reminder "\n")))))
(let ((section (magit-todos--insert-groups :type 'todos
:heading (format "%s (%s)%s"
(propertize "TODOs" 'face 'magit-section-heading)
Expand Down Expand Up @@ -728,8 +727,7 @@ sections."
item))
(truncate-string-to-width it width))))
(magit-insert-section (todos-item item)
(insert string))
(insert "\n"))))))
(insert string "\n")))))))
(magit-todos--set-visibility :depth depth :num-items (length items) :section section)
;; Don't forget to return the section!
section))
Expand Down

0 comments on commit 2d48f84

Please sign in to comment.