From 790179e268856511078d12999e180294db2c0bf8 Mon Sep 17 00:00:00 2001 From: "Anand Babu (AB) Periasamy" Date: Wed, 15 Jul 2015 11:13:31 -0700 Subject: [PATCH] fix scanbar prefix printing for large prefixes --- pb.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pb.go b/pb.go index 85d2cdfb..129c85ad 100644 --- a/pb.go +++ b/pb.go @@ -217,11 +217,10 @@ func scanBarFactory(prefix string) scanBarFunc { fileCount := 0 termSize, _ := ts.GetSize() termWidth := termSize.Col() - cursorCh := cursorAnimate() return func(source string) { - scanPrefix := fmt.Sprintf("Scanning %s [%s] %s ", prefix, humanize.Comma(int64(fileCount)), string(<-cursorCh)) + scanPrefix := fmt.Sprintf("[%s] %s ", humanize.Comma(int64(fileCount)), string(<-cursorCh)) if prevLineSize != 0 { // erase previous line console.PrintC("\r" + scanPrefix + strings.Repeat(" ", prevLineSize-len([]rune(scanPrefix)))) }