mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
fix: query_predicate - nth
This commit is contained in:
parent
50a77bbc22
commit
35a8fe5a81
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