Skip to content

Keep the UTF-8 BOM when formatting Bend files - #2339

Draft
oxura wants to merge 1 commit into
bendlang:mainfrom
oxura:fix/fmt-keeps-bom-20261124
Draft

oxura wants to merge 1 commit into
bendlang:mainfrom
oxura:fix/fmt-keeps-bom-20261124

Conversation

@oxura

@oxura oxura commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Keep the BOM separate from the text being formatted so changing indentation doesn’t erase it.

I sent a BOM-bearing document through the real stdio LSP server and checked that the edit still starts with ef bb bf. The formatted file checks in bend --check-only. On Linux, the formatter’s 38 tests and the repo gate (56/56) pass. The mini gates weren’t available.

Fixes #2336

Keep the existing BOM outside the text being reformatted.

Fixes bendlang#2336
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.

Formatting strips a valid UTF-8 byte-order mark

1 participant