Skip to content

fix: utf-16 rendering for multiline errors#257

Open
gerau wants to merge 4 commits intoBlockstreamResearch:masterfrom
gerau:simc/utf16-fix
Open

fix: utf-16 rendering for multiline errors#257
gerau wants to merge 4 commits intoBlockstreamResearch:masterfrom
gerau:simc/utf16-fix

Conversation

@gerau
Copy link
Copy Markdown
Contributor

@gerau gerau commented Mar 27, 2026

Fixes multiline display in case if first line of Error is contains UTF-16 symbol.

Also removes println!() statement in test and revert check for newline in get_line_col to == '\n', because chumsky::is_newline is introducing CRLF regression.

@gerau gerau requested a review from delta1 as a code owner March 27, 2026 11:38
@gerau gerau force-pushed the simc/utf16-fix branch 2 times, most recently from 51e6042 to 009ddc4 Compare March 27, 2026 15:19
@apoelstra
Copy link
Copy Markdown
Contributor

In e26797b: what is going on with this commit? This doesn't compile.

metalurgical added a commit to metalurgical/SimplicityHL that referenced this pull request Mar 30, 2026
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
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.

2 participants