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
4 changes: 0 additions & 4 deletions R/indent.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ indent_without_paren_for_while_fun <- function(pd, indent_by) {
indent_without_paren_if_else <- function(pd, indent_by) {
expr_after_if <- next_non_comment(pd, which(pd$token == "')'")[1])
is_if <- pd$token[1] %in% "IF"
has_if_without_curly <-
is_if && pd$child[[expr_after_if]]$token[1] != "'{'"
if (!is_if) {
return(pd)
}
Expand All @@ -47,8 +45,6 @@ indent_without_paren_if_else <- function(pd, indent_by) {
pd$indent[expr_after_if] <- indent_by
}



else_idx <- which(pd$token == "ELSE")
if (length(else_idx) == 0L) {
return(pd)
Expand Down
3 changes: 1 addition & 2 deletions R/reindent.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ apply_ref_indention <- function(flattened_pd) {
#' @keywords internal
apply_ref_indention_one <- function(flattened_pd, target_token) {
token_to_update <- find_tokens_to_update(flattened_pd, target_token)
# udate spaces
# update spaces
copied_spaces <- flattened_pd$col2[target_token]
old_spaces <- flattened_pd$lag_spaces[token_to_update[1]]
shift <- copied_spaces
flattened_pd$lag_spaces[token_to_update] <-
flattened_pd$lag_spaces[token_to_update] + shift
Expand Down
4 changes: 0 additions & 4 deletions R/rules-line-breaks.R
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,6 @@ set_line_break_before_curly_opening <- function(pd) {
next_non_comment,
pd = pd
)
non_comment_after_expr <- non_comment_after_comma[
non_comment_after_comma > should_not_be_on_same_line_idx[1]
]
pd$lag_newlines[non_comment_after_comma] <- 1L
}
}
Expand Down Expand Up @@ -312,7 +309,6 @@ set_line_break_after_opening_if_call_is_multi_line <- function(pd,
}
break_pos <- find_line_break_position_in_multiline_call(pd)
idx_nested <- next_non_comment(pd, 2)
nested_call <- is_function_call(pd$child[[idx_nested]])
if (pd_is_multi_line(pd$child[[idx_nested]]) && sum(pd$lag_newlines) > 0L) {
break_pos <- c(break_pos, idx_nested)
}
Expand Down
1 change: 0 additions & 1 deletion R/stylerignore.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ add_stylerignore <- function(pd_flat) {
if (!env_current$any_stylerignore) {
return(pd_flat)
}
pd_flat_terminals <- pd_flat[pd_flat$terminal, ]
pd_flat_lat_line1 <- lag(pd_flat$line2, default = 0)
on_same_line <- pd_flat$line1 == pd_flat_lat_line1
cumsum_start <- cumsum(start_candidate & !on_same_line)
Expand Down