If you try to use code_highlight() in RStudio when using a theme that is not included in code_theme_list(), you receive a warning message and the code is returned unhighlighted:
cli::code_highlight("1 + 1")
#> [1] "1 + 1"
#> Warning message:
#> In code_theme_default_rstudio() :
#> cli does not know this RStudio theme: a11y-dark {rsthemes}
It would be preferable to fallback to a default theme if cli does not recognize the current RStudio theme: perhaps to cli:::code_theme_default_term() or "Textmate (default)".
The warning message could be preserved and could also indicate that the user can choose a code highlighting theme using options().
If you try to use
code_highlight()
in RStudio when using a theme that is not included incode_theme_list()
, you receive a warning message and the code is returned unhighlighted:It would be preferable to fallback to a default theme if
cli
does not recognize the current RStudio theme: perhaps tocli:::code_theme_default_term()
or "Textmate (default)". The warning message could be preserved and could also indicate that the user can choose a code highlighting theme usingoptions()
.