mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-02 19:46:58 -04:00
indent: fix wrong line number passed to descendant_for_range
This commit is contained in:
parent
4538a876b4
commit
42bc217a54
1 changed files with 1 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue