You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add configurable wrapping modes for table columns (#195)
* Initial plan
* Add wrapping mode configuration for table columns
- 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>
* Update table wrapping example with documentation
- 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>
* Refactor: Use class constant for valid wrapping modes and optimize width 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>
* Refactor: Add ellipsis constants and simplify pre-colorized check
- 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>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Co-authored-by: Pascal Birchler <pascal.birchler@gmail.com>
0 commit comments