-
Notifications
You must be signed in to change notification settings - Fork 71
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
cli_vec: vec-trunc not working #652
Comments
Closing, I thought |
It is supposed to do that, but somehow the minimal amount is now 5, which is not documented and doesn't make much sense IMHO. library(cli)
for(i in 3:7){
x <- cli_vec(names(mtcars), list("vec-trunc"=i))
cli_text("Column names (max={i}): {x}.")
}
#> Column names (max=3): mpg, cyl, disp, ..., gear, and carb.
#> Column names (max=4): mpg, cyl, disp, ..., gear, and carb.
#> Column names (max=5): mpg, cyl, disp, ..., gear, and carb.
#> Column names (max=6): mpg, cyl, disp, hp, ..., gear, and carb.
#> Column names (max=7): mpg, cyl, disp, hp, drat, ..., gear, and carb. Created on 2024-02-21 with reprex v2.0.2 Moreover, the documentation of I think you should reopen your issue :-) |
Digging in the code, I found that "vec-trunc" is used in The current issue is documented (although not justified) in
I guess this limit was set to ensure readability, but I don't understand why not let the user decide what is readable or not... Alternatively, you can use nms <- cli_vec(names(mtcars), list("vec_trunc"=2, "vec-trunc-style"="head"))
cli_text("Column names: {nms}.") I guess this will be fixed when they update the documentation of |
See library(cli)
x <- cli_vec(names(mtcars), list("vec-trunc" = 3, "vec-trunc-style" = "head"))
cli_text("Column names: {x}.")
|
With {cli} 3.6.1.
Directly from the examples of
cli_vec()
:Created on 2023-11-24 with reprex v2.0.2
vec-sep
andvec-last
are not affected.The text was updated successfully, but these errors were encountered: