Skip to content

Add --wrap=word option for word wrapping #3352

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
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

krikera
Copy link
Contributor

@krikera krikera commented Jul 31, 2025

Implements word wrapping functionality that splits text at word boundaries instead of character boundaries, improving readability especially for markdown files.

Changes:

  • Add WrappingMode::Word enum variant
  • Update clap argument parser to accept 'word' as wrap mode
  • Implement word wrapping logic in InteractivePrinter
  • Fix printer selection to use InteractivePrinter for explicit wrap modes
  • Add comprehensive tests for word vs character wrapping
  • Update documentation, help text, and shell completions
  • Add changelog entry

Fixes #3324

krikera added 2 commits July 31, 2025 12:42
Implements word wrapping functionality that splits text at word boundaries
instead of character boundaries, improving readability especially for
markdown files.

Changes:
- Add WrappingMode::Word enum variant
- Update clap argument parser to accept 'word' as wrap mode
- Implement word wrapping logic in InteractivePrinter
- Fix printer selection to use InteractivePrinter for explicit wrap modes
- Add comprehensive tests for word vs character wrapping
- Update documentation, help text, and shell completions
- Add changelog entry

Fixes sharkdp#3324
Copy link
Collaborator

@keith-hall keith-hall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for having a go at this! I especially like how the completions, help and man pages were all updated! 🎊
I have a few concerns and questions on the implementation, please don't let it put you off 🙂

@krikera
Copy link
Contributor Author

krikera commented Aug 1, 2025

Thank you for the review! I appreciate the feedback.

@Enselic
Copy link
Collaborator

Enselic commented Aug 22, 2025

Labeling as "waiting-on-author" since CI fails (it might become green after rebase).

@Enselic Enselic added the waiting-on-author Progress on this PR is blocked mostly because we are waiting on the author of the PR to do something label Aug 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-on-author Progress on this PR is blocked mostly because we are waiting on the author of the PR to do something
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Line wrapping
3 participants