Skip to content

Commit 5365a63

Browse files
Merge pull request #190 from DavisVaughan/fix/cli-force
Do not `force` cli to refresh the display
2 parents dcf5cc0 + 8867012 commit 5365a63

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

NEWS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Version (development version)
22

3+
* `handler_cli()` no longer forces a display update after every
4+
tick, instead relying on cli itself to decide how often to
5+
refresh the display. This results in much better performance.
6+
7+
38
## Deprecated and Defunct
49

510
* Remove `progress()`, which has been defunct since **progressr**

R/handler_cli.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ handler_cli <- function(show_after = 0.0, intrusiveness = getOption("progressr.i
8484
cli_progress_call(cli::cli_progress_bar, total = total, ...)
8585
}
8686

87-
cli_progress_update <- function(id, ..., force = TRUE, .envir) {
87+
cli_progress_update <- function(id, ..., .envir) {
8888
## WORKAROUND: Do not involve 'cli' when total = 0
8989
if (.envir$total == 0) return(id)
90-
cli_progress_call(cli::cli_progress_update, id = id, ..., force = force, .envir = .envir)
90+
cli_progress_call(cli::cli_progress_update, id = id, ..., .envir = .envir)
9191
}
9292

9393
cli_progress_done <- function(id, ..., .envir) {
@@ -116,7 +116,7 @@ handler_cli <- function(show_after = 0.0, intrusiveness = getOption("progressr.i
116116
}
117117
} else {
118118
cli_progress_bar <- function(total, ...) "id-dummy"
119-
cli_progress_update <- function(id, ..., force = TRUE, .envir) "id-dummy"
119+
cli_progress_update <- function(id, ..., .envir) "id-dummy"
120120
cli_progress_done <- function(id, ..., .envir) "id-dummy"
121121
erase_progress_bar <- function(pb) NULL
122122
redraw_progress_bar <- function(pb) NULL

0 commit comments

Comments
 (0)