Skip to content

Fix SplitOverflow with fullwidth characters#2009

Open
bijesh-bits wants to merge 2 commits intospectreconsole:mainfrom
bijesh-bits:fix/paragraph-splitlines-fullwidth
Open

Fix SplitOverflow with fullwidth characters#2009
bijesh-bits wants to merge 2 commits intospectreconsole:mainfrom
bijesh-bits:fix/paragraph-splitlines-fullwidth

Conversation

@bijesh-bits
Copy link

fixes #1787

  • I have read the Contribution Guidelines
  • I have commented on the issue above and discussed the intended changes
  • A maintainer has signed off on the changes and the issue was assigned to me
  • All newly added code is adequately covered by tests
  • All existing tests are still running without errors
  • The documentation was modified to reflect the changes OR no documentation changes are required.

Changes

  • Fix Segment.SplitOverflow so it doesn’t use Substring() with cell width for fullwidth characters.
  • Use cell‑width‑aware truncation for Crop and Ellipsis.
  • Add unit tests covering fullwidth strings for SplitOverflow with both Ellipsis and Crop.

Testing

  • dotnet test src/Spectre.Console.Tests/Spectre.Console.Tests.csproj -c Release --filter FullyQualifiedName~SegmentTests
    • Not run locally (requires .NET SDK 10.0.101 per global.json).

Please upvote 👍 this pull request if you are interested in it.

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.

Paragraph.SplitLines fails to split a string if it contains Japanese characters

1 participant

Comments