File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88* The ` {.obj_type_friendly} ` inline style now only shows the first class
99 name (#669 @olivroy ).
1010
11+ * Syntax highlighting now does not fail in RStudio if the rstudioapi
12+ package is not installed (#697 ).
13+
1114# cli 3.6.2
1215
1316* ` ansi_collapse(x, trunc = 1, style = "head") ` now indeed shows one
Original file line number Diff line number Diff line change @@ -240,12 +240,14 @@ code_theme_default <- function() {
240240 if (rs $ type %in% c(" rstudio_console" , " rstudio_console_starting" )) {
241241 opt <- code_theme_opt(" cli.code_theme_rstudio" )
242242 if (! is.null(opt )) return (opt )
243- code_theme_default_rstudio()
244- } else {
245- opt <- code_theme_opt(" cli.code_theme_terminal" )
246- if (! is.null(opt )) return (opt )
247- code_theme_default_term()
243+ if (requireNamespace(" rstudioapi" , quietly = TRUE )) {
244+ return (code_theme_default_rstudio())
245+ }
248246 }
247+
248+ opt <- code_theme_opt(" cli.code_theme_terminal" )
249+ if (! is.null(opt )) return (opt )
250+ code_theme_default_term()
249251}
250252
251253code_theme_opt <- function (option ) {
You can’t perform that action at this time.
0 commit comments