mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-02 11:36:54 -04:00
fix(indent): return early if query doesn't exist
This commit is contained in:
parent
b8ddb83d60
commit
ad75d3c4bd
1 changed files with 3 additions and 0 deletions
|
|
@ -96,6 +96,9 @@ local get_indents = memoize(function(bufnr, root, lang)
|
|||
|
||||
--TODO(clason): remove when dropping Nvim 0.8 compat
|
||||
local query = (ts.query.get or ts.get_query)(lang, "indents")
|
||||
if not query then
|
||||
return map
|
||||
end
|
||||
for id, node, metadata in query:iter_captures(root, bufnr) do
|
||||
if query.captures[id]:sub(1, 1) ~= "_" then
|
||||
map[query.captures[id]][node:id()] = metadata or {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue