Skip to content

Wrong brace indention with two consecutive braces and strict = FALSE #430

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
lorenzwalthert opened this issue Sep 30, 2018 · 4 comments
Closed

Comments

@lorenzwalthert
Copy link
Collaborator

Migrated from #428.

@lorenzwalthert
Copy link
Collaborator Author

text <- '
eventReactive({

    code()
},
    {
    code()
    }
    )
    '

styler::style_text(text, strict = FALSE)
#> 
#> eventReactive({
#> 
#>   code()
#> },    {
#>   code()
#> }
#> )

Created on 2018-09-28 by the reprex package (v0.2.1)

@lorenzwalthert
Copy link
Collaborator Author

lorenzwalthert commented Oct 14, 2018

This seems tricky to resolve because it would require to determine indention level of the first { / } based on whether the whole expression ends on the same line as the first { / }. I.e. it seems as the correct code would be as follows for the two cases:

eventReactive({
    code()
  },
  {
    code()
  }
)

vs.

eventReactive({
  code()
})

@lorenzwalthert
Copy link
Collaborator Author

Also, we have a postponed issue about simplification of indent indices computation (#76) which we'd better resolve first.

@lorenzwalthert
Copy link
Collaborator Author

lorenzwalthert commented Apr 25, 2019

Actually, this is pretty much a special case of #485 as I see it now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant