Fix showing data usage indicators
This commit is contained in:
parent
4880d31120
commit
2b1fb662fb
3 changed files with 21 additions and 7 deletions
|
|
@ -38,7 +38,11 @@ func EscapeAwareRuneCountInString(s string) int {
|
|||
}
|
||||
|
||||
func RightPad(str string, length int) string {
|
||||
return str + strings.Repeat(" ", length-EscapeAwareRuneCountInString(str))
|
||||
c := length - EscapeAwareRuneCountInString(str)
|
||||
if c < 0 {
|
||||
c = 0
|
||||
}
|
||||
return str + strings.Repeat(" ", c)
|
||||
}
|
||||
|
||||
// WrapString wraps the given string within lim width in characters.
|
||||
|
|
|
|||
Loading…
Reference in a new issue