Skip to content

Indention based on operators only checks first potential trigger #141

Closed
@lorenzwalthert

Description

@lorenzwalthert

Indention based on operators only checks first potential trigger.

test <- c(
  "1 + (", 
  "3", 
  ") %>%", 
  "x()"
)
cat(styler::style_text(test), sep = "\n")
#> 1 + (
#>   3
#> ) %>%
#> x()

x() is not indented since it is only checked whether + causes indention (which is not the case since a multi-line expression follows and ( will cause indention within the child). However, we need to check for all potential token that are triggers (+ and %>% here) and then indent on the first one for which we need indention.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions