If I make a manual edit, don't revert it in the following prompt

A common flow for me is:

  1. Cursor implements a new component
  2. I accept, then make a small manual edit (e.g. relabelling, changing an icon, tweaking a class)
  3. I continue prompting Cursor to modify the component

But 3 will often immediately suggest reverting the change I make in 2, which is highly frustrating. My current workaround is to make a new chat after 2, so that 3 has my change in context and does not try to change it.

Is there a better way to do this? Could Cursor become aware of my change (e.g. update its context version of a file if I save it)?

1 Like
  1. Ask the AI to do it by quoting or mentioning it in your prompt besides whatever else you are doing.

  2. Add the @file to the context, or just the code block so it gets “updated” in it’s dialog

  3. Start a new chat which will pick up only the latest version.

  1. Much faster for me to add my 1 class than to explain to the AI what i want to be added, to what component, wait for it to process, accept, etc
  2. It is already in the context from my first step
  3. This is what I’m already doing; its a pain to start a new chat and add all the previous files back to context

Why don’t you add it in the context of the last step? In the first step you added the original file before any modifications. The context doesn’t know your extra changes, it will see the Agent’s changes only and expect to rewrite the file appending that version with new text and overwrite it.

Another option that works less and less lately is to prompt the Agent to provide DIFF only, no context. That is, ask it to give back only line changes with number and sign, no context lines before or after. This way, only changed lines are returned, not the whole file.

1 Like