Cursor re-writes the whole code from scratch at the bottom of the code

Hello,

This has been happening a lot lately.

Cursor procceeds on making the changes it’s supposed to and then it keeps re-writing the whole code from the beginning, at the bottom of the new code. You can see an example at the image above.

1 Like

Thank you for the report. We’ll have a look.

1 Like

Is this with GPT-4 or GPT-3.5?

1 Like

It’s with GPT4, I managed to find a workaround, I noticed that this is happening because the answer that I get it is not very specific as to where exactly to make the changes in the code (it has many “…” comments confusing the model as to where exactly to make the changes. (when code is more than 400 lines). So if I give it a prompt like this :

“please respond again but understand where exactly you put these “…” because the way you put them you can’t really understand in which line they are being put and what to skip and when you want to enter the code you get confused as to where exactly to put it and what to skip. please be more specific in your response and answer again !”

Then it responds in snippets like that :

I apologize for the confusion. Here’s a more detailed breakdown of the changes:

  1. Update the itemsPerPage constant to 7:
    (solution…)

  2. Add the handleNext and handlePrevious functions:
    (solution…)

  3. Update the FlatList component in the return statement of AddPartsUnified:

(solution…)

this way it does not lose navigation as to where to make the changes and most of the time it works pretty well