Cursor recently started frequently adding a new line between lines of code. I’m not sure if this is only happening in css files or not, I will have to check. I even added the following to a rules file to no avail:
Match existing file line density. Do not insert blank lines between every statement, prop, or JSX attribute.
Let Prettier control spacing. Run the formatter mentally against repo .prettierrc before saving test and component files.
Steps to Reproduce
Send a prompt to the agent that results in changes to files.
Expected Behavior
New lines aren’t added where they aren’t needed or wanted
Hey, thanks for the detailed report and the screenshot. I can see extra blank lines between every line of code.
This is a known issue we’re tracking, and it’s not caused by the model or your rules, so “line density” rules won’t help here. It’s about line endings. When a file uses CRLF, the line endings can get doubled when writing, like \r\r\n, and each pair of lines shows up with an empty line between them. Those bytes are actually written to disk, so prompts can’t fix it.
Workaround for now:
Open the affected file and check the line ending indicator in the bottom-right of the status bar. If it says CRLF, click it, switch to LF, then save.
Or run the file through Prettier (or dos2unix) to normalize line endings.
To confirm your case is exactly this pattern, next time it happens could you share:
The Request ID chat menu in the top-right > Copy Request ID
A hex dump of the first lines of the file, for example in PowerShell: Format-Hex .\path\to\file | Select-Object -First 5 We’re looking for 0D 0D 0A instead of 0D 0A
I’ve passed this to the team. I’ll post an update here when we have one.