From 58030e6d6f1d6609b43dcb765d54539dcc6a1a76 Mon Sep 17 00:00:00 2001 From: Riley Bruins Date: Sat, 7 Sep 2024 08:24:47 -0700 Subject: 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. --- scripts/format-queries.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/format-queries.lua b/scripts/format-queries.lua index 0f6b77f1e..9deccdc07 100755 --- a/scripts/format-queries.lua +++ b/scripts/format-queries.lua @@ -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 -- cgit v1.2.3-70-g09d2