Skip to content

Account for ASCII control character display width - #1021

Open
subotac wants to merge 3 commits into
Wilfred:masterfrom
subotac:fix/control-character-display-width
Open

Account for ASCII control character display width#1021
subotac wants to merge 3 commits into
Wilfred:masterfrom
subotac:fix/control-character-display-width

Conversation

@subotac

@subotac subotac commented Aug 1, 2026

Copy link
Copy Markdown

Summary

  • account for the rendered width of non-tab control characters
  • keep wrapped and side-by-side output aligned
  • add focused regression coverage

Fixes #569

Testing

  • focused regression test
  • unit and documentation tests
  • cargo fmt --all -- --check

AI-assisted tooling was used for test development I reviewed and verified every submitted line and can explain the change.

@Wilfred

Wilfred commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Thanks for the PR. Have you confirmed that the characters render at the same width both with and without less?

@subotac

subotac commented Aug 2, 2026

Copy link
Copy Markdown
Author

Thanks! I have only verified the width calculation with the regression test so far, not the actual rendering both directly and through less. I'll check both modes at the same terminal width and report back.

subotac added 2 commits August 2, 2026 19:48
Keep ANSI escapes and line endings intact while converting source control characters to caret notation.
@subotac

subotac commented Aug 2, 2026

Copy link
Copy Markdown
Author

Confirmed both paths. The updated output renders non-formatting ASCII controls as caret notation; the issue fixtures contain no raw Unit Separator bytes, and the direct output is byte-for-byte identical after less -F -X. All CI checks pass.

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.

Unprintable characters break side-by-side view

2 participants