You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The Render function gumbles up a potentially already rendered string or some other input which contains ansi sequences when using a spaced styler (useSpaceStyler==true). This happens because the processing happens rune wise and is not ansi aware.
ifuseSpaceStyler {
// Look for spaces and apply a different styler// while remaining ansi awarewithinAnsi:=falsefor_, r:=rangel[i] {
switch {
casewithinAnsi&&ansi.IsTerminator(r):
withinAnsi=falseb.WriteRune(r)
caser==ansi.Marker||withinAnsi:
withinAnsi=trueb.WriteRune(r)
default: // aka !withinAnsiifunicode.IsSpace(r) {
b.WriteString(teSpace.Styled(string(r)))
continue
}
b.WriteString(te.Styled(string(r)))
}
}
} // ....
while this solution correctly applies the strike through effect only the first letter 'F' is bold as the first render call places the reset at the end which ends the bold effect after rendering the 'F' ...
Describe the bug
The Render function gumbles up a potentially already rendered string or some other input which contains ansi sequences when using a spaced styler (useSpaceStyler==true). This happens because the processing happens rune wise and is not ansi aware.
Setup
To Reproduce
see source code which results in
Source Code
Result
Fancy
Fancy
1mFancy[0mExpected behavior
Fancy
Fancy
Fancy (with strike-through effect)
Additional context
space styling can be enabled other ways as well but ".Strikethrough(true)" will do just fine.
The text was updated successfully, but these errors were encountered: