Get progress bar rendering working

This commit is contained in:
Kovid Goyal
2022-11-16 16:35:15 +05:30
parent dd1fcf6855
commit ae93d95bbe
4 changed files with 42 additions and 6 deletions

View File

@@ -47,10 +47,12 @@ func RenderProgressBar(frac float64, width int) string {
}
ans := fc.Blue(filled)
unfilled := ""
ul := 0
if width > fl && needs_break {
unfilled = "🬇"
ul = 1
}
filler := width - fl - len(unfilled)
filler := width - fl - ul
if filler > 0 {
unfilled += RepeatChar("🬋", filler)
}