Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 23, 2026

The unwrapCommitMessageBody function assumed fixed 2-space continuation indent for all list items. This broke unwrapping for numbered lists with multi-digit markers (10., 100.) and didn't match GitHub's lenient continuation rules.

Changes

  • Track content indent instead of marker indent - List continuations now compute the actual text start position (1. = 3, 10. = 4, etc.)
  • Allow 1+ space continuations - GitHub accepts any indentation ≥1 space for list continuations (still treating 4+ as code blocks)
  • Preserve list context across blank lines - Multi-paragraph lists now unwrap correctly without losing the list item association
  • Trim whitespace in plain text joining - Prevents double spaces when joining lines with leading whitespace

Example

Before (broken):

10.  Multi-digit numbers should also
     work for a continuation.

→ Lines not joined (treated as separate due to hardcoded +2 indent check)

After (fixed):

10.  Multi-digit numbers should also work for a continuation.

Test coverage added

  • Multi-digit numbered lists
  • Multi-paragraph lists (numbered and asterisk)
  • Code blocks within list items
  • Variable space continuations (1-3 spaces)
  • Nested versions of all above

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • update.code.visualstudio.com
    • Triggering command: /opt/hostedtoolcache/node/20.20.0/x64/bin/node /opt/hostedtoolcache/node/20.20.0/x64/bin/node ./out/src/test/runTests.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Improve commit line break unwrapping</issue_title>
<issue_description>> Opened #8335 to address this.

Thanks @alexr00 for improving this! Unfortunately I think the follow-up PR might have some problems too, and may need some more tests. See #8335 (comment)

Originally posted by @justingrant in #8255 (comment)
</issue_description>

<agent_instructions>Pay special attention to #8335 (comment)</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits January 23, 2026 17:36
- Fix list continuation to use content indent (not marker indent)
- Support variable-length numbered list markers (1., 10., 100., etc.)
- Allow flexible continuation spacing (1+ spaces, but not 4+ which is code)
- Preserve multi-paragraph list formatting (blank lines within list items)
- Track list context across blank lines for proper paragraph unwrapping
- Add comprehensive test cases for all scenarios

Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Use appendWithSpace with trimmed text to avoid double spaces when joining
lines with leading whitespace.

Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Copilot AI changed the title [WIP] Improve commit line break unwrapping Improve commit line break unwrapping for variable-length list markers Jan 23, 2026
Copilot AI requested a review from alexr00 January 23, 2026 17:40
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.

Improve commit line break unwrapping

2 participants