fix: prevent double indent from pipes

This commit is contained in:
Oliver Thomas
2024-07-30 21:05:09 +02:00
committed by Christian Clason
parent 8e569bc4b5
commit 65310b64ee
3 changed files with 4 additions and 2 deletions

View File

@@ -2,8 +2,6 @@
(braced_expression)
(parenthesized_expression)
(call)
"special"
"|>"
"if"
"else"
"while"

View File

@@ -0,0 +1,2 @@
mtcars %>%
head() %>%

View File

@@ -35,6 +35,8 @@ describe("indent R:", function()
run:new_line("pipe.R", { on_line = 1, text = "head(n = 10L) |>", indent = 2 })
run:new_line("pipe.R", { on_line = 9, text = "head()", indent = 2 })
run:new_line("incomplete_pipe.R", { on_line = 2, text = "head %>%", indent = 2 })
run:new_line("aligned_indent.R", { on_line = 1, text = "z,", indent = 17 })
end)
end)