mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-14 09:20:04 -04:00
r(indents): fix brace_list alignment
This commit is contained in:
parent
3b974b7257
commit
cf9faaa0e3
3 changed files with 8 additions and 4 deletions
|
|
@ -3,6 +3,7 @@
|
||||||
(paren_list)
|
(paren_list)
|
||||||
(special)
|
(special)
|
||||||
(pipe)
|
(pipe)
|
||||||
|
(call)
|
||||||
"|>"
|
"|>"
|
||||||
"if"
|
"if"
|
||||||
"else"
|
"else"
|
||||||
|
|
@ -16,10 +17,6 @@
|
||||||
")"
|
")"
|
||||||
] @branch
|
] @branch
|
||||||
|
|
||||||
|
|
||||||
((call) @aligned_indent
|
|
||||||
(#set! "delimiter" "()"))
|
|
||||||
|
|
||||||
((formal_parameters (identifier)) @aligned_indent
|
((formal_parameters (identifier)) @aligned_indent
|
||||||
(#set! "delimiter" "()"))
|
(#set! "delimiter" "()"))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,3 +10,9 @@ foo <- function(x) {
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
baz <- function(l) {
|
||||||
|
inner(l, function(x) {
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ describe("indent R:", function()
|
||||||
run:new_line("func.R", { on_line = 2, text = "a <- a + 1", indent = 4 })
|
run:new_line("func.R", { on_line = 2, text = "a <- a + 1", indent = 4 })
|
||||||
run:new_line("func.R", { on_line = 6, text = "0,", indent = 6 })
|
run:new_line("func.R", { on_line = 6, text = "0,", indent = 6 })
|
||||||
run:new_line("func.R", { on_line = 6, text = "0,", indent = 6 })
|
run:new_line("func.R", { on_line = 6, text = "0,", indent = 6 })
|
||||||
|
run:new_line("func.R", { on_line = 16, text = "x <- x + 1", indent = 4 })
|
||||||
|
|
||||||
run:new_line("loop.R", { on_line = 1, text = "x <- x + 1", indent = 0 })
|
run:new_line("loop.R", { on_line = 1, text = "x <- x + 1", indent = 0 })
|
||||||
run:new_line("loop.R", { on_line = 3, text = "x <- x + 1", indent = 2 })
|
run:new_line("loop.R", { on_line = 3, text = "x <- x + 1", indent = 2 })
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue