-
Notifications
You must be signed in to change notification settings - Fork 70
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
Truncating silently markup in RStudio when string ends with markup. #627
Comments
Oh! I just discovered something else: the bug occurs in some situations, but having inline markup at the end of the string seems to be more problematic. # This works as expected
to_print <- "A long {.val value} with a {.href [link](https://github.com)} with other stuff like {.help cli::inline-markup} is okay." Once the end of string inline markup bug is fixed, I can see if silent truncation comes up in other situations. I can circumvent this by setting |
@gaborcsardi I tried creating a failing test for that, but could not see what was wrong. I am only able to reproduce in RStudio interactively. I tried the following. but the snapshot looks fine, but does not reflect the interactive behavior. expect_snapshot({
withr::local_envvar(
R_CLI_HYPERLINKS = "true",
R_CLI_HYPERLINK_RUN = "true"
)
rlang::local_interactive()
withr::local_options(cli.unicode = TRUE)
withr::local_options(cli.num.color = 256L)
withr::local_options(cli.width = 25)
cli_text("A {.val veryaaaaa} long hyperlink {.href [text](https://github.com)}")
}
) Edit: this problem has more impact than I thought also. It seemed to interfere in a styler warning that I saw yesterday. maybe related to #562? |
Hi @gaborcsardi, do you think this is a cli or RStudio issue? Do you think it will be fixed by rstudio/rstudio#13869. If so, maybe mention it for QA. |
Does it happen outside of RStudio? E.g. in a (non-RStudio) terminal? |
Doesn't seem like it. (although I don't have a terminal that supports links) Are you able to see this behavior with this reprex in a terminal? (the word value doesn't appear)
|
It works in a terminal. It is probably this issue: #560, already reported to RStudio. |
Edit: RStudio issue fixed in 2023.12.0 version
Possibly the string widths are not correctly assessed?,
Output of my RStudio console
Expected (works when cli.width >= 68.) i.e. if your console width is wider than 68 when not setting options.
because it seems to work as expected in the reprex
Created on 2023-08-30 with reprex v2.0.2
Related to #578, because I first encountered this behaviour at startup, but this seems like a different issue.
Note: I used
options(cli.width)
here for reproducibility purpose only, but I am trying to recreate the behavior when not setting options.Let me know if I can provide more info. (I am still on an older RStudio version 2023.06.1, but I don't think this has been changed recently.)
The text was updated successfully, but these errors were encountered: