diff options
| author | Stephan Seitz <stephan.seitz@fau.de> | 2022-02-06 19:31:24 +0100 |
|---|---|---|
| committer | Stephan Seitz <stephan.seitz@fau.de> | 2022-02-06 20:47:15 +0100 |
| commit | 5fd68ba0c26e2f5daf4826f3d436fef42a01ecf0 (patch) | |
| tree | 725e83818aa215ab163b7deb141fc4531c605fbd | |
| parent | fix: readme typo, removing deprecated docs (diff) | |
| download | nvim-treesitter-5fd68ba0c26e2f5daf4826f3d436fef42a01ecf0.tar nvim-treesitter-5fd68ba0c26e2f5daf4826f3d436fef42a01ecf0.tar.gz nvim-treesitter-5fd68ba0c26e2f5daf4826f3d436fef42a01ecf0.tar.bz2 nvim-treesitter-5fd68ba0c26e2f5daf4826f3d436fef42a01ecf0.tar.lz nvim-treesitter-5fd68ba0c26e2f5daf4826f3d436fef42a01ecf0.tar.xz nvim-treesitter-5fd68ba0c26e2f5daf4826f3d436fef42a01ecf0.tar.zst nvim-treesitter-5fd68ba0c26e2f5daf4826f3d436fef42a01ecf0.zip | |
indents(lua): make ")" `@indent_end
Fixes #2476
| -rw-r--r-- | queries/lua/indents.scm | 2 | ||||
| -rw-r--r-- | tests/indent/lua/no-indent-after-paren-pairs.lua | 6 | ||||
| -rw-r--r-- | tests/indent/lua_spec.lua | 2 |
3 files changed, 10 insertions, 0 deletions
diff --git a/queries/lua/indents.scm b/queries/lua/indents.scm index 8c4432d56..fb6bb2820 100644 --- a/queries/lua/indents.scm +++ b/queries/lua/indents.scm @@ -15,6 +15,8 @@ [ "end" + ")" + "}" ] @indent_end (return_statement diff --git a/tests/indent/lua/no-indent-after-paren-pairs.lua b/tests/indent/lua/no-indent-after-paren-pairs.lua new file mode 100644 index 000000000..2243b4029 --- /dev/null +++ b/tests/indent/lua/no-indent-after-paren-pairs.lua @@ -0,0 +1,6 @@ +-- Issue #2476 +require("treesitter").setup( +) + +local table = { +} diff --git a/tests/indent/lua_spec.lua b/tests/indent/lua_spec.lua index b90c9b66e..2da965e48 100644 --- a/tests/indent/lua_spec.lua +++ b/tests/indent/lua_spec.lua @@ -36,5 +36,7 @@ describe("indent Lua:", function() run:new_line("cond.lua", { on_line = 8, text = "x = x + 1", indent = 4 }) run:new_line("cond.lua", { on_line = 10, text = "x = x + 1", indent = 2 }) run:new_line("cond.lua", { on_line = 12, text = "x = x + 1", indent = 0 }) + run:new_line("no-indent-after-paren-pairs.lua", { on_line = 3, text = "x = x + 1", indent = 0 }) + run:new_line("no-indent-after-paren-pairs.lua", { on_line = 6, text = "x = x + 1", indent = 0 }) end) end) |
