Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
inherits from classes `character`, `utf8` or `vertical` (#693).
- logical operators within square braces are now moved from the start of a line
to the end of the previous line (#709).
- spaces are now removed before `[` and `[[` (#713).
- minor documentation improvements (#643, #618, #614, #677, #651, #667, #672,
#687).
- The internal `create_tree()` only used in testing of styler now works when the
Expand Down
2 changes: 1 addition & 1 deletion R/rules-spaces.R
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ remove_space_after_unary_pm_nested <- function(pd) {
}

remove_space_before_opening_paren <- function(pd_flat) {
paren_after <- pd_flat$token == "'('"
paren_after <- pd_flat$token %in% c("'('", "'['", "LBB")
if (!any(paren_after)) {
return(pd_flat)
}
Expand Down
4 changes: 4 additions & 0 deletions tests/testthat/spacing/spacing-square-in.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ a[2 ]
a[ 2]

a[ 2 ]


a [[2]]
a [1]
29 changes: 22 additions & 7 deletions tests/testthat/spacing/spacing-square-in_tree

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions tests/testthat/spacing/spacing-square-out.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ a[2]
a[2]

a[2]


a[[2]]
a[1]