Complete textwrap.wrap() with 6 missing params!#207
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #207 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 15 15
Lines 986 1030 +44
Branches 247 263 +16
=========================================
+ Hits 986 1030 +44 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
40d2ccc to
fd42dd3
Compare
**New** Parameters ``expand_tabs``, ``replace_whitespace``, ``fix_sentence_endings``, ``drop_whitespace``, ``max_lines``, and ``placeholder`` for ``wrap()``, completing stdlib ``textwrap.wrap()`` compatibility. Wrote code mostly for 'drop_whitespace' and 'placeholder', and found a very peculiar bug in standard python's textwrap fix_sentence_endings, that '\n' is "of length 1" -- the other parameters simply needed to be "wired in".
fd42dd3 to
1ee7f15
Compare
jquast
added a commit
to jquast/blessed
that referenced
this pull request
Feb 6, 2026
Bugfix by integration with wcwidth.width() 0.6.0, just released, jquast/wcwidth#207 Closes #351.
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
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.
Make available all keyword parameters for
wcwidth.wrap()astextwrap.wrap().New Parameters expand_tabs, replace_whitespace, fix_sentence_endings, drop_whitespace, max_lines, and placeholder for wrap(), completing stdlib textwrap.wrap() compatibility.
Code mostly for 'drop_whitespace' and 'placeholder', and, that I found a very peculiar bug in standard python's textwrap fix_sentence_endings, that '\n' is "of length 1" -- anyway this argument is rarely used -- the other parameters simply needed to be "wired in", I forgot them!