Skip to content

Commit 0318cbf

Browse files
FIX: The 'txtprogressbar' handler would not redraw itself when there had been zero progress
1 parent 6d4eb58 commit 0318cbf

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

R/handler_txtprogressbar.R

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,12 @@ eraseTxtProgressBar <- function(pb) {
125125
} else if (style == 3L) {
126126
n <- 3L + nw * width + 6L
127127
}
128-
cat("\r", strrep(" ", times = n), "\r", sep = "", file = file)
129-
.nb <- 0L
128+
cat("\r", strrep(" ", times = n), "\r", sep = "", file = file)
130129
flush.console()
130+
131+
## Reset internal counter, cf. utils::txtProgressBar()
132+
.nb <- 0L
133+
.pc <- -1L
131134
})
132135
}
133136

0 commit comments

Comments
 (0)