mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-10 15:30:01 -04:00
parent
f16a775830
commit
4836c1df65
3 changed files with 9 additions and 1 deletions
|
|
@ -16,10 +16,12 @@
|
||||||
|
|
||||||
[
|
[
|
||||||
"end"
|
"end"
|
||||||
")"
|
|
||||||
"}"
|
"}"
|
||||||
] @indent.end
|
] @indent.end
|
||||||
|
|
||||||
|
(")" @indent.end
|
||||||
|
(#not-has-parent? @indent.end parameters))
|
||||||
|
|
||||||
(return_statement
|
(return_statement
|
||||||
(expression_list
|
(expression_list
|
||||||
(function_call))) @indent.dedent
|
(function_call))) @indent.dedent
|
||||||
|
|
@ -39,3 +41,6 @@
|
||||||
(comment) @indent.auto
|
(comment) @indent.auto
|
||||||
|
|
||||||
(string) @indent.auto
|
(string) @indent.auto
|
||||||
|
|
||||||
|
(ERROR
|
||||||
|
"function") @indent.begin
|
||||||
|
|
|
||||||
|
|
@ -7,3 +7,5 @@ function foo(x)
|
||||||
1,
|
1,
|
||||||
2)
|
2)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function hi()
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ describe("indent Lua:", function()
|
||||||
run:new_line("func.lua", { on_line = 4, text = "y = y + 1", indent = 2 })
|
run:new_line("func.lua", { on_line = 4, text = "y = y + 1", indent = 2 })
|
||||||
run:new_line("func.lua", { on_line = 5, text = "3,", indent = 4 })
|
run:new_line("func.lua", { on_line = 5, text = "3,", indent = 4 })
|
||||||
run:new_line("func.lua", { on_line = 9, text = "x = x + 1", indent = 0 })
|
run:new_line("func.lua", { on_line = 9, text = "x = x + 1", indent = 0 })
|
||||||
|
run:new_line("func.lua", { on_line = 11, text = "x = x + 1", indent = 2 })
|
||||||
run:new_line("string.lua", { on_line = 1, text = "x", indent = 0 })
|
run:new_line("string.lua", { on_line = 1, text = "x", indent = 0 })
|
||||||
run:new_line("string.lua", { on_line = 2, text = "x", indent = 0 })
|
run:new_line("string.lua", { on_line = 2, text = "x", indent = 0 })
|
||||||
run:new_line("string.lua", { on_line = 3, text = "x", indent = 2 })
|
run:new_line("string.lua", { on_line = 3, text = "x", indent = 2 })
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue