Closed dzfrias closed 1 year ago
There's a problem that prevents some specific styles from being reset with \x1b[0m. The problem is with Style::patch(...), but this PR should fix it.
\x1b[0m
Style::patch(...)
let contents = "\x1b[1mText\x1b[0m\x1b[36mText2\x1b[0m"; dbg!(contents.into_text().unwrap());
Text { lines: [ Spans( [ Span { content: "Text", style: Style { fg: None, bg: None, add_modifier: BOLD, sub_modifier: (empty), }, }, Span { content: "Text2", style: Style { fg: Some( Cyan, ), bg: None, add_modifier: (empty), sub_modifier: (empty), }, }, ], ), ], }
Text { lines: [ Spans( [ Span { content: "Text", style: Style { fg: None, bg: None, add_modifier: BOLD, sub_modifier: (empty), }, }, Span { content: "Text2", style: Style { fg: Some( Cyan, ), bg: None, add_modifier: BOLD, sub_modifier: (empty), }, }, ], ), ], }
I rebased the last commit with this and will merge this pr. Thank you for the fixes :)
There's a problem that prevents some specific styles from being reset with
\x1b[0m
. The problem is withStyle::patch(...)
, but this PR should fix it.Recreating
Expected
Got