glue icon indicating copy to clipboard operation
glue copied to clipboard

More control over width in glue_collapse

Open hadley opened this issue 5 years ago • 1 comments

Ideally, if width was set it would only show complete items, and there would be an option to show how many were omitted

x <- c("1234567890")

# Instead of:
glue::glue_collapse(rep(x, 2), sep = ", ", width = 20)
#> 1234567890, 12345...
# it would be nice to have:
#> 1234567890, ...

# And an option that did this:
glue::glue_collapse(rep(x, 10), sep = ", ", width = 20, and = "and {n} more")
#> 1234567890, and 9 more

hadley avatar Aug 30 '18 19:08 hadley

Yeah this is similar to https://github.com/tidyverse/glue/issues/104

jimhester avatar Aug 30 '18 19:08 jimhester

No longer needed, since cli handles this.

hadley avatar Jan 26 '23 23:01 hadley