-
Notifications
You must be signed in to change notification settings - Fork 115
Add configurable wrapping modes for table columns #195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Copilot
wants to merge
5
commits into
main
Choose a base branch
from
copilot/fix-wordwrapping-issue
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+326
−15
Conversation
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
- Add setWrappingMode() method to Ascii renderer and Table class - Support three modes: 'wrap' (default), 'word-wrap', and 'truncate' - word-wrap mode wraps at word boundaries (spaces/hyphens) - truncate mode truncates with ellipsis (...) - Add helper methods wrapText() and wordWrap() for wrapping logic - Add tests for new functionality Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
- Add comprehensive examples for all three wrapping modes - Include explanations of when to use each mode - Add usage instructions in the example output - Make executable with proper shebang Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix wordwrapping in the tabular output
Add configurable wrapping modes for table columns
Feb 2, 2026
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
…dth tracking - Define VALID_WRAPPING_MODES as a private class constant for better maintainability - Optimize wordWrap() by tracking width incrementally instead of recalculating Colors::width() on every iteration - Addresses code review feedback from @swissspidy Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
- Define ELLIPSIS and ELLIPSIS_WIDTH as class constants for better maintainability - Remove redundant width check in pre-colorized condition (already validated earlier) - Addresses code review feedback from @swissspidy Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
This comment was marked as resolved.
This comment was marked as resolved.
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
This PR implements configurable wrapping modes for table cells to address the issue where long text (like plugin names) is split at awkward character boundaries, making it difficult to copy and paste.
Changes
Asciirenderer:wrap(default): Character-boundary wrapping (preserves backward compatibility)word-wrap: Word-boundary wrapping (splits at spaces/hyphens)truncate: Truncates with ellipsis (...)setWrappingMode()method toTableandAsciiclasseswrapText()andwordWrap()Usage Example
Visual Comparison
Before (character-boundary):
❌ Splits mid-word, hard to copy
With word-wrap:
✅ Keeps words intact, easy to copy
With truncate:
✅ Compact single-line display
Security Summary
No security vulnerabilities detected. All code changes are focused on text formatting logic with proper input validation.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.