Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: handle last empty line correctly when using update/overwrite #274

Merged
merged 1 commit into from
Mar 3, 2024

Conversation

dummdidumm
Copy link
Contributor

When the string passed to update or overwrite ends with a new line, the mappings will contain two entries for column zero. This happens because the loop does not bail if the last line is empty, filling two lines with the same mapping. This commit fixes that. Fixes #273

When the string passed to update or overwrite ends with a new line, the mappings will contain two entries for column zero. This happens because the loop does not bail if the last line is empty, filling two lines with the same mapping. This commit fixes that.
Fixes Rich-Harris#273
@antfu antfu merged commit 29c7bfa into Rich-Harris:master Mar 3, 2024
12 checks passed
@dummdidumm dummdidumm deleted the update-empty-line branch March 4, 2024 08:15
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.

Wrong mappings when update or overwrite end with new line
2 participants