summaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
authorMunif Tanjim <hello@muniftanjim.dev>2021-08-03 20:10:29 +0600
committerSantos Gallegos <stsewd@protonmail.com>2021-08-03 21:45:16 -0500
commit35a8fe5a81534f58d4f49560410fb125f90b42f2 (patch)
tree2bcb202ff0da1e81e197d43e3df6c43f54223d08 /lua
parent50a77bbc22055fc5665d5de3c7a135f5990e9132 (diff)
fix: query_predicate - nth
Diffstat (limited to 'lua')
-rw-r--r--lua/nvim-treesitter/query_predicates.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/lua/nvim-treesitter/query_predicates.lua b/lua/nvim-treesitter/query_predicates.lua
index 2a3b4c38..20cb4274 100644
--- a/lua/nvim-treesitter/query_predicates.lua
+++ b/lua/nvim-treesitter/query_predicates.lua
@@ -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