We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 14aebe0 commit 08f9ec1Copy full SHA for 08f9ec1
R/rules-indention.R
@@ -54,12 +54,12 @@ indent_op <- function(pd,
54
indent_eq_sub <- function(pd,
55
indent_by,
56
token = c("EQ_SUB", "EQ_FORMALS")) {
57
- eq_sub <- which(pd$token %in% token)
58
- if (length(eq_sub) == 0) {
+ eq_sub <- pd$token %in% token
+ if (!any(eq_sub)) {
59
return(pd)
60
}
61
- has_line_break <- which(pd$lag_newlines > 0)
62
- indent_indices <- intersect(eq_sub + 1, has_line_break)
+ has_line_break <- pd$lag_newlines > 0
+ indent_indices <- lag(eq_sub, default = FALSE) & has_line_break
63
pd$indent[indent_indices] <- pd$indent[indent_indices] + indent_by
64
pd
65
0 commit comments