Cursor adds newline to files with existing newlines

Hey, thanks for the report. This is a known issue the team is working on.

The bug affects files that were modified by Agent or indexing, and it adds trailing newlines when the IDE starts, ignoring files.insertFinalNewline and files.trimFinalNewlines.

Workaround (works for some users):

  1. Open the changed files in the Source Control panel
  2. Click “Keep” for each file
  3. Remove the extra blank line
  4. After restarting the IDE, the issue should stop for those files

Related threads with more info: