Make the Style enum a proper Ordinal (no holes) (#8282)
The Style enum needs to be an Ordinal so that it can be used in sets.
This commit is contained in:
parent
6de52d2b74
commit
1102f9aaf1
1 changed files with 7 additions and 4 deletions
|
|
@ -471,11 +471,12 @@ type
|
||||||
styleBright = 1, ## bright text
|
styleBright = 1, ## bright text
|
||||||
styleDim, ## dim text
|
styleDim, ## dim text
|
||||||
styleItalic, ## italic (or reverse on terminals not supporting)
|
styleItalic, ## italic (or reverse on terminals not supporting)
|
||||||
styleUnderscore = 4, ## underscored text
|
styleUnderscore, ## underscored text
|
||||||
styleBlink, ## blinking/bold text
|
styleBlink, ## blinking/bold text
|
||||||
styleReverse = 7, ## reverse
|
styleBlinkRapid, ## rapid blinking/bold text (not widely supported)
|
||||||
styleHidden ## hidden text
|
styleReverse, ## reverse
|
||||||
styleStrikethrough, ## strikethrough
|
styleHidden, ## hidden text
|
||||||
|
styleStrikethrough ## strikethrough
|
||||||
|
|
||||||
{.deprecated: [TStyle: Style].}
|
{.deprecated: [TStyle: Style].}
|
||||||
{.deprecated: [styleUnknown: styleItalic].}
|
{.deprecated: [styleUnknown: styleItalic].}
|
||||||
|
|
@ -921,6 +922,8 @@ proc disableTrueColors*() =
|
||||||
trueColorIsEnabled = false
|
trueColorIsEnabled = false
|
||||||
|
|
||||||
when not defined(testing) and isMainModule:
|
when not defined(testing) and isMainModule:
|
||||||
|
assert ansiStyleCode(styleBright) == "\e[1m"
|
||||||
|
assert ansiStyleCode(styleStrikethrough) == "\e[9m"
|
||||||
#system.addQuitProc(resetAttributes)
|
#system.addQuitProc(resetAttributes)
|
||||||
write(stdout, "never mind")
|
write(stdout, "never mind")
|
||||||
stdout.eraseLine()
|
stdout.eraseLine()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue