fix: calculate columns from line starts - #2215
Open
Eljees wants to merge 1 commit into
Open
Conversation
Signed-off-by: Eljees <3.14hell@gmail.com>
Eljees
requested review from
bryanbeverly,
dustin-decker,
dxa4481 and
zricethezav
as code owners
July 28, 2026 09:36
Author
Author
|
Following up on my ping of 9 August, with a correction to it: CI has not run on either PR. The #2215 calculates columns from line starts rather than from the match offset; #2219 requires the identifier to end with the keyword in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Fixes #1424.
Newline matches contain both the newline byte offset and the first byte of the next line. The location calculation previously used the newline byte itself as the column offset, so matches after the first line were shifted one column to the right. This change tracks the actual line start separately while preserving the existing line-slice indexes.
The regression coverage now derives newline indexes from realistic LF and CRLF input, verifies identical matches on the first and later lines, and updates the affected expected coordinates for plain and decoded findings.
Tested with Go 1.24.11:
Checklist: