Skip to content

Fix SplitOverflow with fullwidth characters#2009

Merged
patriksvensson merged 2 commits intospectreconsole:mainfrom
bijesh-bits:fix/paragraph-splitlines-fullwidth
Feb 20, 2026
Merged

Fix SplitOverflow with fullwidth characters#2009
patriksvensson merged 2 commits intospectreconsole:mainfrom
bijesh-bits:fix/paragraph-splitlines-fullwidth

Conversation

@bijesh-bits
Copy link
Copy Markdown
Contributor

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.

@patriksvensson patriksvensson merged commit cfeb231 into spectreconsole:main Feb 20, 2026
3 checks passed
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

2 participants