Changes the whole file! instead of only an end=point

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

changes the whole file! instead of only an end=point

Steps to Reproduce

just use cursor!

Expected Behavior

to only change what’s its supposed to!

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.0.43 (Universal)
VSCode Version: 1.99.3
Commit: 8e4da76ad196925accaa169efcae28c45454cce0
Date: 2025-10-30T18:49:27.589Z
Electron: 34.5.8
Chromium: 132.0.6834.210
Node.js: 20.19.1
V8: 13.2.152.41-electron.0
OS: Darwin x64 23.6.0

Additional Information

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

Hey @orbisius,

I see two likely causes:

  • Discarding changes in Git then asking the AI to edit the file can leave the AI unaware that the previous changes were removed.
    • Let the AI know you discarded changes before asking it to edit again.
    • Especially gets tricky when you repeat the same process multiple times in the same chat, so it may be worthwhile to try on a new chat.
  • A formatting extension could be reformatting the whole file after the AI makes a change. So that’s worth checking - is it applying its rules to the entire document?
    • I think this is the main problem.

Try disabling extensions temporarily with cursor --disable-extensions, and turn off “Format on Save” in VS Code settings (from Cursor > Settings > VS Code settings menu) as well.

Verify whether only the intended part changes after this. Hopefully this helps narrow down the problem.

1 Like

I told it multiple times that I had reverted the changes it made. it applied to one file. other 4-5 files were fine and followed the instructions.

To me, it sounds like this file may not have been formatted correctly by your project’s formatting logic in the first place, which is likely causing this fix? :thinking: Try comparing how formatting without any extensions goes, or with another editor to compare.

That’s all I have; other experienced Cursor users or staff may have additional insights.

It looks like the model only edits one line (changes msg to messages). So is it really changing the whole file? I am doubtful its messing up the file syntax or making a bunch of edits behind the scene. If it was confused of the state of the file, it would unnecessarily make additional changes, not make those changes invisibly.

Something worth trying: if you discard the changes (like in your video), then make the fix manually yourself (the same change the model did), then sync the changes, do you get the same result? That might narrow it down between if its the model or something with your file or git. May be worth discarding the changes and rebooting Cursor if the issue persists.

1 Like

This might be related to formatter.

Please try @arun’s suggestions:

  1. Disable Format on Save: Settings > search “format on save” > uncheck it
  2. Test without extensions: Run cursor --disable-extensions from terminal to temporarily disable all extensions (including Dart/Flutter extensions)

After disabling these, test if the AI change still triggers the whole-file diff. This should confirm whether it’s the Dart formatter causing this.

Let us know if that resolves it!

1 Like

thank you for the suggestions. nothing is set to format on save