fixed inline diff formatting

This commit is contained in:
Noah Campbell
2025-09-15 12:45:54 -05:00
parent b1d9a69e01
commit c1653b9b54
3 changed files with 4 additions and 3 deletions

View File

@@ -470,14 +470,15 @@ func readLinesFromReader(reader io.Reader, maxBytes int) ([]string, error) {
for scanner.Scan() {
line := normalizeNewlines(scanner.Text())
lineBytes := len(line) + 1 // +1 for newline
lineWithNL := line + "\n"
lineBytes := len(lineWithNL)
if totalBytes+lineBytes > maxBytes {
lines = append(lines, "... (content truncated due to size)")
lines = append(lines, "... (content truncated due to size)\n")
break
}
lines = append(lines, line)
lines = append(lines, lineWithNL)
totalBytes += lineBytes
}