Skip to content

Conversation

kmvanbrunt
Copy link
Member

Removed rich_utils.string_to_rich_text() in favor of monkey patching Rich's Text.from_ansi(). Now a dev isn't required to call a cmd2-specific function to get the bug fix.

Monkey patched Rich's Segment.apply_style() to fix an issue where background colors incorrectly carry over onto the following line when printing with soft_wrap enabled.

Copy link

codecov bot commented Sep 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.78%. Comparing base (d60e1a8) to head (fad918a).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1501   +/-   ##
=======================================
  Coverage   98.78%   98.78%           
=======================================
  Files          23       23           
  Lines        4927     4955   +28     
=======================================
+ Hits         4867     4895   +28     
  Misses         60       60           
Flag Coverage Δ
unittests 98.78% <100.00%> (+<0.01%) ⬆️

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.

Rich's Text.from_ansi(). Now a dev isn't required to call a
cmd2-specific function to get the bug fix.

Monkey patched Rich's Segment.apply_style() to fix an issue where
background colors incorrectly carry over onto the following line
when printing with soft_wrap enabled.
Copy link
Member

@tleonhardt tleonhardt left a comment

Choose a reason for hiding this comment

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

I like this elegant solution.

@kmvanbrunt kmvanbrunt merged commit 401bb8b into main Sep 6, 2025
30 checks passed
@kmvanbrunt kmvanbrunt deleted the patch_rich branch September 6, 2025 15:20
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.

2 participants