Skip to content

Fix missing newline between TODOs and next section when ungrouped#209

Open
kovan wants to merge 1 commit intoalphapapa:masterfrom
kovan:fix/missing-newline-ungrouped
Open

Fix missing newline between TODOs and next section when ungrouped#209
kovan wants to merge 1 commit intoalphapapa:masterfrom
kovan:fix/missing-newline-ungrouped

Conversation

@kovan
Copy link

@kovan kovan commented Feb 26, 2026

Fixes #202 — no blank line between ungrouped TODOs section and next magit section.

Two issues in the ungrouped code path:

  1. (1+ depth) passed instead of depth → section parented incorrectly (not at root)
  2. No trailing \n at depth 0, unlike the grouped path

Fix: pass depth directly and add (when (= 0 depth) (insert "\n")) after the dolist.

Verified on Emacs 30.2: reproduced missing newline with magit-todos-group-by nil, applied fix, confirmed \n\n at section boundary.

When TODOs are displayed without grouping, the depth argument was
incorrectly incremented before being passed to magit-todos--insert-group,
causing the section to not be treated as top-level. This also meant no
trailing blank line was inserted after the section body, breaking the
visual separator between it and the next magit section.

Fix by passing depth as-is (instead of (1+ depth)) and adding a
trailing newline in magit-todos--insert-group for top-level sections,
matching the existing behavior in the grouped code path.

Fix: alphapapa#202

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@kovan kovan marked this pull request as draft February 26, 2026 23:48
@kovan kovan marked this pull request as ready for review February 27, 2026 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing newline between TODOs and the next section when not grouping

1 participant