aboutsummaryrefslogtreecommitdiffstats
path: root/queries
diff options
context:
space:
mode:
authorRiley Bruins <ribru17@hotmail.com>2024-07-05 10:17:41 -0700
committerChristian Clason <c.clason@uni-graz.at>2024-07-16 13:17:36 +0200
commit4836c1df6516cc2f895e362f3d00a15a236407b3 (patch)
tree815162c9c389f8440f07acb80eca2a15b3459c09 /queries
parentfeat(python): Improved python indentation (#6859) (diff)
downloadnvim-treesitter-4836c1df6516cc2f895e362f3d00a15a236407b3.tar
nvim-treesitter-4836c1df6516cc2f895e362f3d00a15a236407b3.tar.gz
nvim-treesitter-4836c1df6516cc2f895e362f3d00a15a236407b3.tar.bz2
nvim-treesitter-4836c1df6516cc2f895e362f3d00a15a236407b3.tar.lz
nvim-treesitter-4836c1df6516cc2f895e362f3d00a15a236407b3.tar.xz
nvim-treesitter-4836c1df6516cc2f895e362f3d00a15a236407b3.tar.zst
nvim-treesitter-4836c1df6516cc2f895e362f3d00a15a236407b3.zip
fix(lua): indent functions before they are closed
Fixes #6786
Diffstat (limited to 'queries')
-rw-r--r--queries/lua/indents.scm7
1 files changed, 6 insertions, 1 deletions
diff --git a/queries/lua/indents.scm b/queries/lua/indents.scm
index c05cc4e5f..a5f66ebcc 100644
--- a/queries/lua/indents.scm
+++ b/queries/lua/indents.scm
@@ -16,10 +16,12 @@
[
"end"
- ")"
"}"
] @indent.end
+(")" @indent.end
+ (#not-has-parent? @indent.end parameters))
+
(return_statement
(expression_list
(function_call))) @indent.dedent
@@ -39,3 +41,6 @@
(comment) @indent.auto
(string) @indent.auto
+
+(ERROR
+ "function") @indent.begin