Merge metadata from multiple capture nodes

This commit is contained in:
Garrett Hopper 2025-05-07 12:07:48 -05:00
parent 28d480e062
commit 6ba63e4844

View file

@ -107,8 +107,9 @@ local get_indents = memoize(function(bufnr, root, lang)
return map return map
end end
for id, node, metadata in query:iter_captures(root, bufnr) do for id, node, metadata in query:iter_captures(root, bufnr) do
if query.captures[id]:sub(1, 1) ~= "_" then local cap, nid = query.captures[id], node:id()
map[query.captures[id]][node:id()] = metadata or {} if cap:sub(1, 1) ~= "_" then
map[cap][nid] = vim.tbl_extend("force", map[cap][nid] or {}, metadata or {})
end end
end end