Skip to content

Commit b6b7587

Browse files
Update src/core/tools/readFileTool.ts
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
1 parent 169fb35 commit b6b7587

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/core/tools/readFileTool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ export async function readFileTool(
619619
// Reflect actual displayed line count after truncation (count ALL lines, including empty)
620620
// Handle trailing newline: "line1\nline2\n" should be 2 lines, not 3
621621
let displayedLines = content.length === 0 ? 0 : content.split(/\r?\n/).length
622-
if (displayedLines > 0 && (content.endsWith("\n") || content.endsWith("\r\n"))) {
622+
if (displayedLines > 0 && content.endsWith("\n")) {
623623
displayedLines--
624624
}
625625
const lineRangeAttr = displayedLines > 0 ? ` lines="1-${displayedLines}"` : ""

0 commit comments

Comments
 (0)