Skip to content

Update unicode-width to 0.2.2. - #82

Merged
Canop merged 1 commit into
Canop:mainfrom
hwright:main
Sep 28, 2026
Merged

Canop merged 1 commit into
Canop:mainfrom
hwright:main

Conversation

@hwright

@hwright hwright commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

This is a semver-incompatible change and has a slight behavioral behavioral difference, in that \n is now treated as width 1 (unicode-rs/unicode-width#60). However, as the unicode-width docs point out: "Relying on any character producing a stable width in this crate is likely the sign of a bug."

None of our tests fail with this change.

This has a slighty behavioral change, in that `\n` is now treated as width 1
(unicode-rs/unicode-width#60).  However, as the
`unicode-width` docs point out: "Relying on any character producing a stable
width in this crate is likely the sign of a bug."

None of our tests fail with this change.
@Canop

Canop commented Sep 24, 2026

Copy link
Copy Markdown
Owner

Ouch... There's a lot to check for this "slight behavorial difference"...

@hwright

hwright commented Sep 24, 2026

Copy link
Copy Markdown
Contributor Author

Are there tests (either existing or to be added) which are would demonstrate the kinds of checks required for this change?

@Canop

Canop commented Sep 25, 2026 •

Copy link
Copy Markdown
Owner

Are there tests (either existing or to be added) which are would demonstrate the kinds of checks required for this change?

I don't think there's any breakage, lines are split before measuring and it looks like no code using termimad's normal APIs measures lines with LF kept. But no, you can't really add a test to check that unicode-width returns a zero width for newlines.

@Canop

Canop commented Sep 25, 2026

Copy link
Copy Markdown
Owner

I'll probably merge this this week-end (and maybe reexport the lib so that programs can use the same version)

@Canop
Canop merged commit 30ea07a into Canop:main Sep 28, 2026
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