Skip to content

Allow empty blocks #256

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
krlmlr opened this issue Oct 24, 2017 · 0 comments
Closed

Allow empty blocks #256

krlmlr opened this issue Oct 24, 2017 · 0 comments

Comments

@krlmlr
Copy link
Member

krlmlr commented Oct 24, 2017

styler::style_text("list(function(){})", strict = FALSE, scope = "line_breaks")
#> list(function() {
#> })

We don't need to add a new line if the block is truly empty. This happens occasionally with R6 classes.

styler::style_text("{}", strict = FALSE, scope = "line_breaks")
#> {
#> }

Blocks also occur naked sometimes.

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

2 participants