Skip to content

Commit

Permalink
Add reset options for statusbar rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
PMunch committed Apr 18, 2024
1 parent b23a461 commit b8a49fb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/nimdowpkg/statusbar.nim
Original file line number Diff line number Diff line change
Expand Up @@ -423,11 +423,13 @@ const
0xd0d0d0, 0xdadada, 0xe4e4e4, 0xeeeeee]
resetCode = 0
fontStart = 10
fontStop = 19
fontStop = 20
fgColorStart = 30
fgColorStop = 37
fgColorReset = 39
bgColorStart = 40
bgColorStop = 47
bgColorReset = 49
fgBrightColorStart = 90
fgBrightColorStop = 97
bgBrightColorStart = 100
Expand Down Expand Up @@ -544,6 +546,10 @@ proc renderStringRightAligned(
color = brightColors[sgr[i] - fgBrightColorStart]
elif sgr[i] >= bgBrightColorStart and sgr[i] <= bgBrightColorStop:
bgColor = brightColors[sgr[i] - bgBrightColorStart]
elif sgr[i] == fgColorReset:
color = -1
elif sgr[i] == bgColorReset:
bgColor = -1
elif sgr.len > i + 2 and sgr[i] in {fgColorTable, bgColorTable} and sgr[i + 1] == eightBitColor:
if sgr[i] == fgColorTable:
color = extraColors[sgr[i + 2]]
Expand Down

0 comments on commit b8a49fb

Please sign in to comment.