Skip to content

Commit

Permalink
Merge pull request #1300 from cloudflare/offset
Browse files Browse the repository at this point in the history
Add missing offset adjustment
  • Loading branch information
prymitive authored Feb 20, 2025
2 parents 3d27620 + 63677b3 commit 0c015f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,8 @@ func parseRule(content []byte, node *yaml.Node, offset int) (rule Rule, _ bool)
if exprPart != nil && exprPart.Value.Lines.First != exprPart.Value.Lines.Last {
contentLines := strings.Split(string(content), "\n")
for {
start := exprPart.Value.Lines.First
end := exprPart.Value.Lines.Last
start := exprPart.Value.Lines.First - offset
end := exprPart.Value.Lines.Last - offset
if end > len(contentLines) {
end--
}
Expand Down

0 comments on commit 0c015f5

Please sign in to comment.