File tree 1 file changed +8
-5
lines changed
1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -114,18 +114,21 @@ set_style_transformers <- function() {
114
114
" Enter the name of a style transformer, e.g. `styler::tidyverse_style()`" ,
115
115
current_style
116
116
)
117
- parsed_new_style <- with_handlers({
118
- transformers <- eval(parse(text = new_style ))
119
- style_text(c(" a = 2" , " function() {" , " NULL" , " }" ))
117
+ if (! is.null(new_style )) {
118
+ parsed_new_style <- with_handlers({
119
+ transformers <- eval(parse(text = new_style ))
120
+ style_text(c(" a = 2" , " function() {" , " NULL" , " }" ))
120
121
},
121
122
error = function (e ) {
122
123
abort(paste0(
123
124
" The selected style transformers \" " ,
124
125
new_style , " \" is not valid: " , e $ message
125
126
))
126
127
}
127
- )
128
- options(styler.addins_style_transformer = new_style )
128
+ )
129
+ options(styler.addins_style_transformer = new_style )
130
+ }
131
+
129
132
invisible (current_style )
130
133
}
131
134
You can’t perform that action at this time.
0 commit comments