File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -228,8 +228,13 @@ cnd_message_format_prefixed <- function(cnd,
228228
229229 if (parent ) {
230230 prefix <- sprintf(" Caused by %s" , type )
231+ # FIXME: Enable this by default later on
232+ if (use_red_error_prefix()) {
233+ prefix <- col_prefix(prefix , type )
234+ }
231235 } else {
232- prefix <- col_yellow(capitalise(type ))
236+ prefix <- capitalise(type )
237+ prefix <- col_prefix(prefix , type )
233238 }
234239
235240 evalq({
@@ -270,6 +275,18 @@ cnd_message_format_prefixed <- function(cnd,
270275 }
271276}
272277
278+ col_prefix <- function (prefix , type ) {
279+ if (type == " error" && use_red_error_prefix()) {
280+ col_red(prefix )
281+ } else {
282+ col_yellow(prefix )
283+ }
284+ }
285+
286+ use_red_error_prefix <- function () {
287+ peek_option(" rlang:::use_red_error_prefix" ) %|| % FALSE
288+ }
289+
273290peek_call_format_srcref <- function () {
274291 opt <- peek_option(" rlang_call_format_srcrefs" )
275292 if (is_null(opt )) {
You can’t perform that action at this time.
0 commit comments