Skip to content

Fix middle truncation at ellipsis-only and exact-fit widths - #726

Open
MateehUllah wants to merge 2 commits into
google:masterfrom
MateehUllah:fix-722-middle-truncation-boundaries
Open

MateehUllah wants to merge 2 commits into
google:masterfrom
MateehUllah:fix-722-middle-truncation-boundaries

Conversation

@MateehUllah

Copy link
Copy Markdown

Summary

Fixes #722.

This PR corrects two edge cases in EllipsisMiddleTruncate:

  • Prevents the original string from being appended when only the ellipsis fits.
  • Preserves strings whose length exactly matches the available width.
  • Adds regression tests for both cases.

Testing

Five isolated behavior tests passed, including existing truncation behavior and the new edge cases.

The full project test suite has not been run.

This branch has not been deployed

No deployments
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.

EllipsisMiddleTruncate exceeds requested width when only the ellipsis fits

1 participant