Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Statusbar prettying things #228

Merged
merged 3 commits into from
Apr 20, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add reset options for statusbar rendering
  • Loading branch information
PMunch committed Apr 18, 2024
commit b8a49fb8ff43dba81fd6353ca7dc05c22ebfd73d
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