Clarification on chat history context

let’s say that i carefully set up cursor in the chat to have the desired context:

  1. new chat
  2. preliminary “dialog” to prompt in a certain direction, provide specific sources, etc.
  3. confirmed understanding of the context.

now, i want it to work on specific sections of the code, one at a time, without losing the chat history context. so i could do:

  1. highlight section i want edited
  2. “add to chat” (ctrl + shift + L)
  3. tell it what to do to that section
  4. wait for response
  5. once correct, click the “Apply to Current File” (pro only feature)
  6. wait for the file to be updated (or copy/paste myself)
  7. confirm the update.

this seems pretty bullet-proof in terms of maintaining the chat history context. but really slow, especially because cursor likes to stream the entire file back.

so is there a way that i have have the “Ctrl + K” function remember the chat context? it doesn’t seem to do it automatically. See below, I first prompted the chat to remember {A} as a variable, but the Ctrl + K lost the context.

my 2 questions:

  1. If maintaining chat history context is my top priority - any suggested modifications to the workflow above? (Steps 1-7)
  2. Is there a way to pass the chat history context to the Ctrl + K context?
    • (My only idea is to stuff all of the context into the “rules for AI” system prompt, but that can’t accept embedded references.)

/edit should skip unchanged sections.

Inline Code Edit & Generation doesn’t see your current chat, but that would be a nice feature. You could quickly copy & paste your chat into the instructions.
My bad, you can use @Chat in Ctrl + K.

yes, it does. but my point is that before edit is available, the user needs to wait for the entire answer to stream back into the chat. so for long files or any change that operates over many lines of code, the flow is very slow. is there a way to “cut to the chase” and skip the streaming to go straight to /edit?

You can use @chat in Ctrl + K! It puts the current chat in context


ok that’s exactly what i needed. thank you @arvid220u !

to clarify for others my modified workflow:

  1. new chat
  2. preliminary “dialog” to prompt in a certain direction, provide specific sources, etc.
  3. confirm understanding of the context.
  4. highlight section i want edited
  5. Ctrl + K
  6. type @chat, plus additional instructions
  7. margaritas :clinking_glasses:
1 Like