mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-09 22:43:34 +00:00
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:
committed by
Andreas Rumpf
parent
6de52d2b74
commit
1102f9aaf1
@@ -471,11 +471,12 @@ type
|
||||
styleBright = 1, ## bright text
|
||||
styleDim, ## dim text
|
||||
styleItalic, ## italic (or reverse on terminals not supporting)
|
||||
styleUnderscore = 4, ## underscored text
|
||||
styleUnderscore, ## underscored text
|
||||
styleBlink, ## blinking/bold text
|
||||
styleReverse = 7, ## reverse
|
||||
styleHidden ## hidden text
|
||||
styleStrikethrough, ## strikethrough
|
||||
styleBlinkRapid, ## rapid blinking/bold text (not widely supported)
|
||||
styleReverse, ## reverse
|
||||
styleHidden, ## hidden text
|
||||
styleStrikethrough ## strikethrough
|
||||
|
||||
{.deprecated: [TStyle: Style].}
|
||||
{.deprecated: [styleUnknown: styleItalic].}
|
||||
@@ -921,6 +922,8 @@ proc disableTrueColors*() =
|
||||
trueColorIsEnabled = false
|
||||
|
||||
when not defined(testing) and isMainModule:
|
||||
assert ansiStyleCode(styleBright) == "\e[1m"
|
||||
assert ansiStyleCode(styleStrikethrough) == "\e[9m"
|
||||
#system.addQuitProc(resetAttributes)
|
||||
write(stdout, "never mind")
|
||||
stdout.eraseLine()
|
||||
|
||||
Reference in New Issue
Block a user