indents(r): support special operator

Close #3879
This commit is contained in:
Pedro Castro 2022-11-29 11:52:28 -03:00 committed by Stephan Seitz
parent d05be3742e
commit 161576dde2
3 changed files with 6 additions and 0 deletions

View file

@ -12,6 +12,8 @@
"for"
] @indent
((binary operator: (special)) @indent)
[
"}"
")"

View file

@ -5,3 +5,6 @@ mtcars |>
subset(
cyl > 3
)
mtcars %>%
head()

View file

@ -35,6 +35,7 @@ describe("indent R:", function()
run:new_line("loop.R", { on_line = 14, text = "print('lol')", indent = 4 })
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("aligned_indent.R", { on_line = 1, text = "z,", indent = 17 })
end)