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:
Riley Bruins 2024-09-07 08:24:47 -07:00 committed by Christian Clason
parent 00f128dd73
commit 58030e6d6f

View file

@ -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