Skip to content

Commit 0e03c40

Browse files
authored
Use ansi_nchar() to compute widths (#1609)
Part of #1607
1 parent 7307b47 commit 0e03c40

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

R/reporter-progress.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -521,14 +521,14 @@ issue_header <- function(x, pad = FALSE) {
521521
issue_summary <- function(x, rule = FALSE, simplify = "branch") {
522522
header <- crayon::bold(issue_header(x))
523523
if (rule) {
524-
header <- cli::rule(header, width = max(nchar(header) + 6, 80))
524+
header <- cli::rule(header, width = max(cli::ansi_nchar(header) + 6, 80))
525525
}
526526

527527
paste0(header, "\n", format(x, simplify = simplify))
528528
}
529529

530530
strpad <- function(x, width = cli::console_width()) {
531-
n <- pmax(0, width - crayon::col_nchar(x))
531+
n <- pmax(0, width - cli::ansi_nchar(x))
532532
paste0(x, strrep(" ", n))
533533
}
534534

0 commit comments

Comments
 (0)