Skip to content

fix(truncated): treat CRLF as one line break - #167

Open
arimu1 wants to merge 1 commit into
com-lihaoyi:masterfrom
arimu1:fix/truncated-crlf-line-count-165
Open

arimu1 wants to merge 1 commit into
com-lihaoyi:masterfrom
arimu1:fix/truncated-crlf-line-count-165

Conversation

@arimu1

@arimu1 arimu1 commented Sep 12, 2026 •

Copy link
Copy Markdown

Summary

  • Fix Truncated.handleNormalChar so \r\n and \n\r count as a single line break by checking the CRLF pair before resetting previousSlashN / previousSlashR.
  • Add a regression test that "Hello\r\nWorld" at width 80 yields two lines (not three).

Fixes #165

Test plan

  • ./mill 'pprint.jvm[2.13.15].test' (includes AdvancedTests.truncatedAttrs CRLF case)

Check CRLF pairing before resetting previousSlashN/R so Windows
newlines do not double-count lines and truncate output early.

Fixes com-lihaoyi#165
@arimu1
arimu1 force-pushed the fix/truncated-crlf-line-count-165 branch from e1001a5 to aa76bbc Compare September 12, 2026 13:06

This branch has not been deployed

No deployments
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.

Truncated.handleNormalChar resets CRLF flags before the check, making the \r\n branch dead code

1 participant