Repository navigation
Skip lines emptied by whitespace stripping in wrap - #291
Closed
deepanshupal wants to merge 2 commits into
Closed
deepanshupal wants to merge 2 commits into
deepanshupal wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #291 +/- ##
=======================================
Coverage 87.61% 87.61%
=======================================
Files 41 41
Lines 5611 5613 +2
Branches 1502 1503 +1
=======================================
+ Hits 4916 4918 +2
Misses 321 321
Partials 374 374 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
jquast
added a commit
that referenced
this pull request
Oct 4, 2026
Bugfix `wrap()` should omit an empty line as output, like `textwrap.wrap()` does This is PR #291 with matching libwcwidth change and tests. --------- Co-authored-by: Deepanshu Pal <[email protected]>
Owner
|
merged |
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.
After stripping trailing whitespace, do not append a line that has become empty. Keep the first-line state unchanged so initial indentation still belongs to the first line with content.
Add three regressions for one, two, and four leading spaces before a long word at width 1. Also check that
drop_whitespace=Falsestill preserves those spaces.This closes a remaining edge case of #170, rather than changing the documented whitespace behavior.
Validation on Python 3.10.12/Linux:
mypy --strict wcwidth: no issues in 49 source files.Other Python versions, platforms, docs builds, and the standalone C-library suite were not run. No C code changed; wrapping uses the Python implementation in both modes.