Skip to content

Commit

Permalink
Skip empty captures (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbs authored May 12, 2022
1 parent a87e64f commit 9c30119
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/Runestone/TreeSitter/TreeSitterQueryCursor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ final class TreeSitterQueryCursor {
let match = TreeSitterQueryMatch(captures: captures)
let evaluator = TreeSitterTextPredicatesEvaluator(match: match, stringView: stringView)
result += captures.filter { capture in
return evaluator.evaluatePredicates(in: capture)
return capture.byteRange.length > 0 && evaluator.evaluatePredicates(in: capture)
}
}
return result
Expand Down

0 comments on commit 9c30119

Please sign in to comment.