mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-03 12:06:55 -04:00
fix: query_predicate - nth
This commit is contained in:
parent
d8a1f3be65
commit
75e7ab4297
1 changed files with 1 additions and 1 deletions
|
|
@ -26,7 +26,7 @@ query.add_predicate("nth?", function(match, pattern, bufnr, pred)
|
|||
end
|
||||
|
||||
local node = match[pred[2]]
|
||||
local n = pred[3]
|
||||
local n = tonumber(pred[3])
|
||||
if node and node:parent() and node:parent():named_child_count() > n then
|
||||
return node:parent():named_child(n) == node
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue