tw <= 0 fix
Vladimir Bauer
8 years ago
2 changed file(s) with
2 addition(s)
and
2 deletion(s)
.
Raw diff
Collapse all
Expand all
+1
-1
bar.go
less
more
336
336
}
337
337
338
338
func (s *state) draw(termWidth int, prependWs, appendWs *widthSync) {
339
if termWidth < 0 {
339
if termWidth <= 0 {
340
340
termWidth = s.width
341
341
}
342
342
+1
-1
options.go
less
more
26
26
// WithWidth overrides default width 80
27
27
func WithWidth(w int) ProgressOption {
28
28
return func(c *pConf) {
29
if w > 2 {
29
if w >= 0 {
30
30
c.width = w
31
31
}
32
32
}