feat: add inverted text style#196
Merged
Merged
Conversation
ccbrown
reviewed
Apr 23, 2026
Owner
ccbrown
left a comment
There was a problem hiding this comment.
Thanks for the PR! One comment but otherwise lgtm!
| if !c.style.invert && text_style.invert { | ||
| needs_reset = true; | ||
| } | ||
| } else if text_style.underline || text_style.italic || text_style.invert { |
Owner
There was a problem hiding this comment.
There shouldn't be any need to add italic to the check here since the state of the italic attribute doesn't impact the rendering of empty cells.
Suggested change
| } else if text_style.underline || text_style.italic || text_style.invert { | |
| } else if text_style.underline || text_style.invert { |
Contributor
Author
There was a problem hiding this comment.
Removed the unnecessary italic check for empty cells. cargo test -p iocraft passes. Commit: b3feeeb
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #196 +/- ##
==========================================
+ Coverage 87.92% 88.00% +0.07%
==========================================
Files 35 35
Lines 5617 5662 +45
Branches 5617 5662 +45
==========================================
+ Hits 4939 4983 +44
Misses 569 569
- Partials 109 110 +1
🚀 New features to boost your workflow:
|
This was referenced Apr 24, 2026
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.
What It Does
Adds support for inverted text styling, backed by crossterm's reverse video attribute.
This adds an
invertflag toCanvasTextStyle, exposes the same option onText, and adds aninvert()builder method forMixedTextContent. ANSI rendering now emitsAttribute::Reversewhen inverted text begins and resets when it ends.Focused tests cover ANSI output, direct canvas cell style access,
Text, andMixedText.Related Issues
Fixes #108