Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ansi_collapse() with 1 element prints it twice if both width and style = "head" are set #590

Closed
DesiQuintans opened this issue Mar 17, 2023 · 0 comments · Fixed by #719
Closed
Labels
bug an unexpected problem or unintended behavior tidy-dev-day 🤓 Tidyverse Developer Day rstd.io/tidy-dev-day
Milestone

Comments

@DesiQuintans
Copy link

library(cli)

ansi_collapse(1)
#> [1] "1"
ansi_collapse(1, style = "head")
#> [1] "1"
ansi_collapse(1, style = "head", width = 70)
#> [1] "1, and 1"
ansi_collapse(1, style = "head", width = 70, last = " and again ")
#> [1] "1 and again 1"

Created on 2023-03-17 with reprex v2.0.2

@gaborcsardi gaborcsardi added the bug an unexpected problem or unintended behavior label Mar 17, 2023
@gaborcsardi gaborcsardi added this to the cli 3.7.0 milestone Dec 10, 2023
@gaborcsardi gaborcsardi added the tidy-dev-day 🤓 Tidyverse Developer Day rstd.io/tidy-dev-day label Jul 17, 2024
gaborcsardi added a commit that referenced this issue Aug 28, 2024
Avoid duplication of length 1 vecs when width set using ansi_collapse() - #590
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior tidy-dev-day 🤓 Tidyverse Developer Day rstd.io/tidy-dev-day
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants