Counts empty lines as lines deleted

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

It shows empty lines as lines deleted, even when only adding lines.

Steps to Reproduce

Do any changes in the IDE with the agent. (Only tested with Sonnet 4.5)

Expected Behavior

Only show numbers related to true changes.

Screenshots / Screen Recordings

Operating System

Windows 10/11

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.3.29 (user setup)
VSCode Version: 1.105.1
Commit: 4ca9b38c6c97d4243bf0c61e51426667cb964bd0
Date: 2026-01-08T00:34:49.798Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Windows_NT x64 10.0.19045

For AI issues: which model did you use?

Sonnet 4.5

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey there!

Thanks for reporting this. I have a feeling this is related to line endings.

When edits are applied to a file, there may be a mismatch between your file’s original line endings (CRLF on Windows) and what the agent outputs (LF). Since the diff algorithm compares raw bytes, every line registers as “changed” even though the visible content is identical, hence the inflated deletion count.

A few things that might help narrow this down:

  1. Check your file’s line endings. In VS Code/Cursor, look at the bottom-right status bar. Does it show CRLF or LF?
  2. After the agent makes changes, does the line ending indicator change?

Hi, that doesn’t show for me. It only happens with Sonnet 4.5, not Opus.

afbeelding

Odd. What kind of files are these that are being edited (what’s the file extension)?

Razor!

Update: The problem seems to have ceased after the last update. I guess it’ll remain a mystery what exactly caused it.

1 Like

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.