aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua')
-rw-r--r--lua/nvim-treesitter/indent.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/lua/nvim-treesitter/indent.lua b/lua/nvim-treesitter/indent.lua
index 1f49cc26b..88406c688 100644
--- a/lua/nvim-treesitter/indent.lua
+++ b/lua/nvim-treesitter/indent.lua
@@ -60,7 +60,7 @@ function M.get_indent(lnum)
-- and if the node is an indent node, we should set the indent level as the indent_size
-- and we set the node as the first child of this wrapper node or the wrapper itself
if not node then
- local wrapper = root:descendant_for_range(lnum, 0, lnum, -1)
+ local wrapper = root:descendant_for_range(lnum-1, 0, lnum-1, -1)
node = wrapper:child(0) or wrapper
if indents[node_fmt(wrapper)] ~= nil and wrapper ~= root then
indent = indent_size