aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRiley Bruins <ribru17@hotmail.com>2024-08-04 18:26:18 -0700
committerChristian Clason <c.clason@uni-graz.at>2024-08-05 10:07:41 +0200
commit558c7ad7bf147c1394d971e6a734ea16e440d51a (patch)
tree9ce510beae70b49767e268fb3bb8f7e0728d3fb7
parentbot(lockfile): update perl, typespec (diff)
downloadnvim-treesitter-558c7ad7bf147c1394d971e6a734ea16e440d51a.tar
nvim-treesitter-558c7ad7bf147c1394d971e6a734ea16e440d51a.tar.gz
nvim-treesitter-558c7ad7bf147c1394d971e6a734ea16e440d51a.tar.bz2
nvim-treesitter-558c7ad7bf147c1394d971e6a734ea16e440d51a.tar.lz
nvim-treesitter-558c7ad7bf147c1394d971e6a734ea16e440d51a.tar.xz
nvim-treesitter-558c7ad7bf147c1394d971e6a734ea16e440d51a.tar.zst
nvim-treesitter-558c7ad7bf147c1394d971e6a734ea16e440d51a.zip
fix(lua): proper indent after multiline string arg
-rw-r--r--queries/lua/indents.scm1
-rw-r--r--tests/indent/lua/string.lua4
-rw-r--r--tests/indent/lua_spec.lua1
3 files changed, 6 insertions, 0 deletions
diff --git a/queries/lua/indents.scm b/queries/lua/indents.scm
index a5f66ebcc..84303b8ab 100644
--- a/queries/lua/indents.scm
+++ b/queries/lua/indents.scm
@@ -17,6 +17,7 @@
[
"end"
"}"
+ "]]"
] @indent.end
(")" @indent.end
diff --git a/tests/indent/lua/string.lua b/tests/indent/lua/string.lua
index adfebf76a..f44fc7231 100644
--- a/tests/indent/lua/string.lua
+++ b/tests/indent/lua/string.lua
@@ -3,3 +3,7 @@ a
multiline
string
]]
+
+print [[
+test
+]]
diff --git a/tests/indent/lua_spec.lua b/tests/indent/lua_spec.lua
index b54ec6512..6d99a0fff 100644
--- a/tests/indent/lua_spec.lua
+++ b/tests/indent/lua_spec.lua
@@ -28,6 +28,7 @@ describe("indent Lua:", function()
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 = 4, text = "x", indent = 4 })
+ run:new_line("string.lua", { on_line = 9, text = "x", indent = 0 })
run:new_line("table.lua", { on_line = 1, text = "b = 0,", indent = 2 })
run:new_line("table.lua", { on_line = 5, text = "4,", indent = 4 })
run:new_line("table.lua", { on_line = 7, text = "4,", indent = 4 })