mirror of
https://github.com/mfontanini/presenterm.git
synced 2025-05-05 23:42:59 +00:00
fix: re-set original colors after printing colored text
This commit is contained in:
parent
55639a4523
commit
6f305ef5b1
@ -136,11 +136,6 @@ impl TextStyle {
|
|||||||
Ok(styled)
|
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 {
|
fn add_flag(mut self, flag: TextFormatFlags) -> Self {
|
||||||
self.flags |= flag as u8;
|
self.flags |= flag as u8;
|
||||||
self
|
self
|
||||||
|
@ -116,7 +116,7 @@ impl<'a> TextDrawer<'a> {
|
|||||||
|
|
||||||
// Crossterm resets colors if any attributes are set so let's just re-apply colors
|
// 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 the format has anything on it at all.
|
||||||
if style.has_modifiers() {
|
if style != Default::default() {
|
||||||
terminal.set_colors(*self.default_colors)?;
|
terminal.set_colors(*self.default_colors)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user