mirror of
https://github.com/nvim-treesitter/nvim-treesitter
synced 2024-09-16 14:34:05 +02:00
fix(formatter): adapt formatter for nightly
After Neovim pull #30193, the formatter was broken due to changes in the way node data is passed to predicates.
This commit is contained in:
parent
00f128dd73
commit
58030e6d6f
1 changed files with 4 additions and 2 deletions
|
@ -14,7 +14,8 @@ else
|
|||
end
|
||||
|
||||
ts.query.add_predicate("kind-eq?", function(match, _, _, pred)
|
||||
local node = match[pred[2]]
|
||||
local cap = match[pred[2]]
|
||||
local node = type(cap) == "table" and cap[1] or cap
|
||||
if not node then
|
||||
return true
|
||||
end
|
||||
|
@ -24,7 +25,8 @@ ts.query.add_predicate("kind-eq?", function(match, _, _, pred)
|
|||
end, true)
|
||||
|
||||
ts.query.add_predicate("is-start-of-line?", function(match, _, _, pred)
|
||||
local node = match[pred[2]]
|
||||
local cap = match[pred[2]]
|
||||
local node = type(cap) == "table" and cap[1] or cap
|
||||
if not node then
|
||||
return true
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue