remove break line in spinner line

pull/9855/head
alonyb 2020-12-02 01:23:46 -05:00
parent 2e3e0ab751
commit 7a0a2b0063
1 changed files with 12 additions and 3 deletions

View File

@ -31,11 +31,11 @@ func applyPrefix(prefix, format string) string {
}
// applyStyle translates the given string if necessary then adds any appropriate style prefix.
func applyStyle(st style.Enum, useColor bool, format string) string {
func applyStyle(st style.Enum, useColor bool, format string, spinner bool) string {
format = translate.T(format)
s, ok := style.Config[st]
if !s.OmitNewline {
if !s.OmitNewline && !spinner {
format += "\n"
}
@ -55,6 +55,15 @@ func stylized(st style.Enum, useColor bool, format string, a ...V) string {
if a == nil {
a = []V{{}}
}
format = applyStyle(st, useColor, format)
format = applyStyle(st, useColor, format, false)
return Fmt(format, a...)
}
// spinnerStylized applies formatting to the provided template
func spinnerStylized(st style.Enum, useColor bool, format string, a ...V) string {
if a == nil {
a = []V{{}}
}
format = applyStyle(st, useColor, format, true)
return Fmt(format, a...)
}