Skip to content

fix: CRLF newline handling and error span rendering#262

Open
metalurgical wants to merge 1 commit intoBlockstreamResearch:masterfrom
metalurgical:fix_issue_260
Open

fix: CRLF newline handling and error span rendering#262
metalurgical wants to merge 1 commit intoBlockstreamResearch:masterfrom
metalurgical:fix_issue_260

Conversation

@metalurgical
Copy link
Copy Markdown

Previously, newline detection operated per character, causing CRLF to be treated as two separate newlines. This resulted in incorrect line numbers, extra blank lines, and misaligned error spans on Windows inputs.

This change introduces CRLF-aware newline parsing while preserving support for LF, CR, and Unicode newline characters.

Also fixes:

  • incorrect line/column calculation for multi-line spans
  • UTF-16 column alignment for multi-byte characters
  • off-by-one error in multiline underline rendering
  • zero-length spans not displaying a caret

Merge after PR #257

Previously, newline detection operated per character, causing CRLF to be
treated as two separate newlines. This resulted in incorrect line numbers,
extra blank lines, and misaligned error spans on Windows inputs.

This change introduces CRLF-aware newline parsing while preserving support
for LF, CR, and Unicode newline characters.

Also fixes:
- incorrect line/column calculation for multi-line spans
- UTF-16 column alignment for multi-byte characters
- off-by-one error in multiline underline rendering
- zero-length spans not displaying a caret

Error rendering is now consistent across platforms and input encodings.

Merge after PR BlockstreamResearch#257
@metalurgical metalurgical requested a review from delta1 as a code owner March 30, 2026 16:45
@metalurgical
Copy link
Copy Markdown
Author

resolves #261
closes #261

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.

1 participant