fix: re-set original colors after printing colored text

This commit is contained in:
Matias Fontanini 2025-02-01 14:41:07 -08:00
parent 55639a4523
commit 6f305ef5b1
2 changed files with 1 additions and 6 deletions

View File

@ -136,11 +136,6 @@ impl TextStyle {
Ok(styled)
}
/// Checks whether this style has any modifiers (bold, italics, etc).
pub(crate) fn has_modifiers(&self) -> bool {
self.flags != 0
}
fn add_flag(mut self, flag: TextFormatFlags) -> Self {
self.flags |= flag as u8;
self

View File

@ -116,7 +116,7 @@ impl<'a> TextDrawer<'a> {
// Crossterm resets colors if any attributes are set so let's just re-apply colors
// if the format has anything on it at all.
if style.has_modifiers() {
if style != Default::default() {
terminal.set_colors(*self.default_colors)?;
}
}