Skip to content

Commit da94fe0

Browse files
authored
Merge pull request #207 from MegaRedHand/fix/change-max-unknown
fix: set length to unknown if set to -1
2 parents dcad234 + 9151851 commit da94fe0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

progressbar.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,11 @@ func (p *ProgressBar) ChangeMax64(newMax int64) {
849849
p.config.useIECUnits)
850850
}
851851

852-
p.lengthKnown(newMax)
852+
if newMax == -1 {
853+
p.lengthUnknown()
854+
} else {
855+
p.lengthKnown(newMax)
856+
}
853857
p.lock.Unlock() // so p.Add can lock
854858

855859
p.Add(0) // re-render

0 commit comments

Comments
 (0)