mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-18 03:10:04 -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
|
end
|
||||||
|
|
||||||
local node = match[pred[2]]
|
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
|
if node and node:parent() and node:parent():named_child_count() > n then
|
||||||
return node:parent():named_child(n) == node
|
return node:parent():named_child(n) == node
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue