mirror of https://github.com/docker/compose.git
pad can be negative on small terminal
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
4434cea535
commit
6a0398d786
|
@ -281,7 +281,11 @@ func numDone(events map[string]Event) int {
|
||||||
func align(l, r string, w int) string {
|
func align(l, r string, w int) string {
|
||||||
ll := lenAnsi(l)
|
ll := lenAnsi(l)
|
||||||
lr := lenAnsi(r)
|
lr := lenAnsi(r)
|
||||||
pad := strings.Repeat(" ", w-ll-lr)
|
pad := ""
|
||||||
|
count := w - ll - lr
|
||||||
|
if count > 0 {
|
||||||
|
pad = strings.Repeat(" ", count)
|
||||||
|
}
|
||||||
return fmt.Sprintf("%s%s%s\n", l, pad, r)
|
return fmt.Sprintf("%s%s%s\n", l, pad, r)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue