Repository navigation
chore(deps): hold unicode-width below 0.2.3 so ratatui keeps sound marks one cell wide - #717
Merged
Merged
Conversation
…rks one cell wide ratatui-core 0.1.2 adds a cell to each halfwidth katakana sound mark (U+FF9E, U+FF9F) because unicode-width used to count them as zero-width. unicode-width 0.2.3 counts them as one cell itself, so with both, ratatui lays "ガ" out over three cells while terminals draw it in two, which fails the buffer_rows test on every platform in #711. Bound unicode-width below 0.2.3 so cargo update and lock file maintenance stay on 0.2.2, and hold Renovate to the same bound, since Renovate otherwise widens the range to admit 0.2.3.
2 tasks
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Renovate's #711 bumps unicode-width to 0.2.3, and every Rust and Nix job then fails
testing::tests::buffer_rows::read_an_offset_area_and_skip_the_cells_wide_symbols_cover, which reads["界ガa", " "]where it expects["界ガa ", " "]. The new width table is correct, but ratatui double counts with it. ratatui-core 0.1.2 adds a cell to each halfwidth katakana sound mark (U+FF9E, U+FF9F) inCellWidth(ratatui/ratatui#2499) because unicode-width used to count them as zero-width, and unicode-width 0.2.3 counts them as one cell itself (unicode-rs/unicode-width#89). Together they layガout over three cells while terminals draw it in two, so ratatui reserves a cell after each mark that the terminal never draws. This PR holds unicode-width at 0.2.2, where ratatui paints each mark one cell wide.The hold has a cost:
ox's own measures, such aswrap.rsand theox --listpadding, still count each mark as zero cells, as onmain, one cell less than ratatui and the terminal draw. unicode-width 0.2.3 would fixox --list, which writes to the terminal directly, but not the TUI, since ratatui would then paint one cell more thanwrap.rsmeasures. Both gaps close once a fixed ratatui lets the bound go.Cargo.tomlrequiresunicode-width = ">=0.2, <0.2.3", socargo updateand lock file maintenance stay on 0.2.2. ratatui-core 0.1.2 is its latest release, ratatui'smainstill adds the cell, and its manifest accepts any unicode-width from 0.2.0, so no ratatui update fixes the combination yet.<bound by default, and a local dry run proposed>=0.2, <0.2.4in the Rust dependencies group. ApackageRulesentry withallowedVersions: "<0.2.3"stops that, so Renovate's rebase of chore(deps): update rust crate xattr to v1.7.0 #711 leaves only xattr 1.7.0.Test plan
main(unicode-width 0.2.3, xattr 1.7.0),cargo test -p ox-tui --lib testing::testsfails with the same["界ガa", " "]as CIcargo update -p unicode-widthlocks nothing, and a fullcargo updatechanges only xattr 1.6.1 → 1.7.0, on whichcargo test --workspacepassesrenovate-config-validator --strict --no-global .github/renovate.jsonpasses, andrenovate --platform=local --dry-run=lookup --enabled-managers=cargoproposes no unicode-width update and keeps xattr 1.7.0 inrenovate/rust-dependenciescargo fmt --check,cargo build,cargo clippy --all-targets,cargo clippy, andcargo doc --no-depspasscargo llvm-cov: 3543 tests pass with 99.17% line coveragecargo deny checkpasses: advisories, bans, licenses, and sources okpnpm format,pnpm lint, andpnpm spellcheckpass