Update version_branch.yml
This commit is contained in:
2
.github/workflows/version_branch.yml
vendored
2
.github/workflows/version_branch.yml
vendored
@@ -192,9 +192,7 @@ data = target.read_bytes()
|
|||||||
|
|
||||||
# Disallow literal tab (0x09) and other ASCII control characters except LF (0x0A) and CR (0x0D).
|
# Disallow literal tab (0x09) and other ASCII control characters except LF (0x0A) and CR (0x0D).
|
||||||
# Report line numbers without printing the raw characters.
|
# Report line numbers without printing the raw characters.
|
||||||
|
|
||||||
def byte_to_line(blob: bytes, idx: int) -> int:
|
def byte_to_line(blob: bytes, idx: int) -> int:
|
||||||
# Count newlines prior to byte offset.
|
|
||||||
return blob[:idx].count(b'
|
return blob[:idx].count(b'
|
||||||
') + 1
|
') + 1
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user