-
Notifications
You must be signed in to change notification settings - Fork 71
Closed
Description
There is a case with wrong formatting of curl braces when styler is run with not default indent (indent_by = 4).
Here is an example:
styler_result <- styler::style_text("
value <- 5
if (value > 0)
print(value)
",
indent_by = 4
)
print(styler_result)
#> # The result looks like:
#> value <- 5
#> if (value > 0) {
#> print(value)
#> }
#> # What I expect to get:
#> value <- 5
#> if (value > 0) {
#> print(value)
#> }
Also, if I run the styler on this output, it won’t change anything.
styler::style_text(
styler_result,
indent_by = 4
)
#> value <- 5
#> if (value > 0) {
#> print(value)
#> }
At the same moment, the example works fine with the default indent (indent_by = 2):
styler::style_text("
value <- 5
if (value > 0)
print(value)
")
#> value <- 5
#> if (value > 0) {
#> print(value)
#> }
Versions.
R: 3.6.3
styler: 1.6.2