Thanks to visit codestin.com
Credit goes to github.com

Skip to content

don't strip whitespace when soft_wrap is True#3937

Merged
willmcgugan merged 4 commits intomasterfrom
trailing-whitespace
Jan 23, 2026
Merged

don't strip whitespace when soft_wrap is True#3937
willmcgugan merged 4 commits intomasterfrom
trailing-whitespace

Conversation

@willmcgugan
Copy link
Member

Fixes #3841

@codecov-commenter
Copy link

codecov-commenter commented Jan 23, 2026

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.86%. Comparing base (56855a6) to head (4d0cbb7).
⚠️ Report is 161 commits behind head on master.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3937      +/-   ##
==========================================
+ Coverage   97.84%   97.86%   +0.02%     
==========================================
  Files          74       96      +22     
  Lines        8152     8335     +183     
==========================================
+ Hits         7976     8157     +181     
- Misses        176      178       +2     
Flag Coverage Δ
unittests 97.86% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@willmcgugan willmcgugan merged commit 05ff970 into master Jan 23, 2026
24 checks passed
@willmcgugan willmcgugan deleted the trailing-whitespace branch January 23, 2026 13:45
wingding12 added a commit to wingding12/rich that referenced this pull request Jan 30, 2026
When soft_wrap=True, the console sets overflow='ignore'. The previous
fix for Textualize#3937 (trailing whitespace) caused the wrap() method to skip
justification entirely when overflow='ignore', resulting in table
titles being left-aligned instead of centered.

The fix restructures the wrap() method to:
1. Always create new_lines and apply justification
2. Only skip truncation when overflow='ignore' (not justification)

Fixes Textualize#3948
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Trailing background color is trimmed when soft wrapping is enabled

2 participants