When you keep asking AI to edit your code and hit “Apply”, the apply lumps everything together (new and old suggestions), instead of applying the last bit, even if the suggested new code is clearly separated and has to be pasted exactly
Is this when you hit Apply a second time, without fully rejecting or accepting the previous Apply suggestions?
Actually these were the steps:
- Asked AI to fix something, it suggested changes.
- I hit apply and accepted suggestions, saved the files.
- Asked AI to provide a modified suggestion for the same file.
- It did so.
- I hit apply, and the suggestions from the new and old AI suggestions were lumped together into the file.
For example, the previous suggestion added a certain class to elements.
The new suggestion removed the old class and added a different class instead.
Hitting apply after the second suggestion resulted in both classes being present, despite only the latter one being present in the suggestion made by AI, specifically Claude.
So Claude offered a new variant.
Whichever model was applying the suggestions took the previous and the newly generated code and lumped things together.
I think it can be challenging to get this through to whichever model is applying the changes. So perhaps a solution could be to add an option in the dropdown to apply ignoring all the previous conversation context.
Yeah I have wondered what the default behaviour is when Cursor makes suggestions:
- Is it looking at the file contents afresh with each prompt?
- Is it looking at the file contents as they were previously supplied in the chat?
- Some combination of both?
I had assumed/hoped it was looking at file contents afresh for each prompt.
But I can understand that may loose some context of previously tried attempts etc.
(much respect to those trying to solve these dynamics - it’s like doing regex in 3 or 4D )