Cursor Keeps Deleting All CSS Rows

Hi, thanks for reporting an issue with Cursor.

Before you report this, we’d appreciate if you can search this forum to see if this issue has already been reported.

If you have done so, please check this box.
on

Describe the Bug

I’m making an web app with Python and every time I ask cursor to edit a few lines of CSS it deletes everything in the file except for what it just added. I will say something like changed the font size for the header to 20px. It then gets confused and retrys a couple of times, then deletes the whole file. I have even told it to not edit or delete any CSS when changing CSS. When I do that, it gets stuck in an loop saying its sorry for having editing issue. The end result still deletes all lines of code in the file.

Steps to Reproduce

Im using Mac OS, I have one CSS styling sheet with a few other templates. When I ask a simple request to change styling it deletes everything. When I ask it to edit an HTML file or other python files. It does not have the same issue.

Expected Behavior

It should not delete all CSS lines of code and only alter the ones that I ask it to.

Screenshots / Screen Recordings

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version 0.44.9

I’m making an web app with Python and every time I ask cursor to edit a few lines of CSS it deletes everything in the file except for what it just added. I will say something like changed the font size for the header to 20px. It then gets confused and retrys a couple of times, then deletes the whole file. I have even told it to not edit or delete any CSS when changing CSS. When I do that, it gets stuck in an loop saying its sorry for having editing issue. The end result still deletes all lines of code in the file.

Additional Information

Please see the screen shot and it should it explain more what is happening with Cursor. I’m making an web app with Python and every time I ask cursor to edit a few lines of CSS it deletes everything in the file except for what it just added. I will say something like changed the font size for the header to 20px. It then gets confused and retrys a couple of times, then deletes the whole file. I have even told it to not edit or delete any CSS when changing CSS. When I do that, it gets stuck in an loop saying its sorry for having editing issue. The end result still deletes all lines of code in the file.

Does this stop you from using Cursor

Yes - Cursor is unusable

1 Like

the same

  1. Is this in an empty window? (if not, try it in a fresh window)
  2. Try adding this to your Rules for AI:

When adding CSS to a file, ensure you only add additional CSS, leaving all existing CSS unchanged.

thank you. second advice helped me

1 Like

Awesome to hear :grin:

1 Like

Thanks for the report. It looks like the AI may be misbehaving here and not responding in the format we tell it to. We’ll try to get this fixed in a future update!

1 Like

Can’t work. Everytime I ask for a simple CSS change, cursor deletes almost all my CSS code. Already tried asking for it not to delete any prexisting code, just make new one, but it doesn’t work. I see this was reported days ago and still hasn’t been fixed. It is impossible to work using cursor. Bad purchase for sure

Hey, have you got a screenshot with an example of this?

If it’s like the original post’s screenshot, where the diff shows something like [Previous content remains the same until..., this is the issue as the apply model expects a different string to know when to keep existing lines.