We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 169fb35 commit b6b7587Copy full SHA for b6b7587
src/core/tools/readFileTool.ts
@@ -619,7 +619,7 @@ export async function readFileTool(
619
// Reflect actual displayed line count after truncation (count ALL lines, including empty)
620
// Handle trailing newline: "line1\nline2\n" should be 2 lines, not 3
621
let displayedLines = content.length === 0 ? 0 : content.split(/\r?\n/).length
622
- if (displayedLines > 0 && (content.endsWith("\n") || content.endsWith("\r\n"))) {
+ if (displayedLines > 0 && content.endsWith("\n")) {
623
displayedLines--
624
}
625
const lineRangeAttr = displayedLines > 0 ? ` lines="1-${displayedLines}"` : ""
0 commit comments