Add FiraCode progress bars glyphs support - #236
Conversation
|
Thanks for the PR! One thing I'd change: the env var currently swaps the whole default template, so it does nothing for var firaBarEls = [barElementCount]string{...}
func init() {
if os.Getenv("UNICODE_PROGRESS_BAR") == "true" { / maybe also to check for "1", etc?
defaultBarEls = firaBarEls
}
} |
|
I choose to preserve only "UNICODE_PROGRESS_BAR=true" and not "1" or "yes" because it may lead to situation when some apps understand specific env value and other (more strict) ignore it. |
|
Had a small review with an llm and found one bug: args 6/7 now fall back to The user's Fix: take the extras only when no bar args were passed at all. case i < barLeftEmpty:
arg = argsH.getNotEmptyOr(i, defaultBarEls[i])
case len(args) == 0:
arg = defaultBarEls[i] // extras come with the default glyph set only
default:
arg = argsH.getOr(i, "") |
|
Thank you! v3.2.0 is out |
This adds support for progress bar glyph sets that need distinct empty/filled border characters, such as the Unicode progress bar glyphs provided by Fira Code.
Changes:
bartemplate element with optional 6th and 7th arguments:bartemplates fully backward compatible.UNICODE_PROGRESS_BAR=truegate (as suggested by FiraCode readme) for using the Unicode progress bar glyphs as the implicit default template.