aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/format-queries.lua6
1 files changed, 4 insertions, 2 deletions
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