getcursor / cursor

The AI Code Editor
https://cursor.com
25.22k stars 1.57k forks source link

Allow concurrent inline edits. #1150

Open gsusI opened 10 months ago

gsusI commented 10 months ago

Context:

I highlight some code I want to edit; I press Ctrl+K to edit, write my prompt and submit; then I go to another section of code and highlight some other code I want to edit; I press Ctrl+K⸺Note that at this point the first inline editor is still opened, changes have not been accepted.

Current behaviour:

It adds the new highlighted code to the existing inline editor.

Expected behaviour:

Open a new inline editor on the newly selected section of the code and keep the previous one open.

Additionally:

You may need to make a list of opened inline editors available somewhere, maybe a section at the same level as the Chat sidebar.

You may need to add a follow-up method (Ctrl+Shift+K?) so the inline chat implements a similar behaviour as the one of the Chat⸺Ctrl+L (ask) and Ctrl+Shift+Y (follow-up) work.

truell20 commented 10 months ago

This should be supported in the newest release (0.21.1)

gsusI commented 10 months ago

@truell20, You're killing it!

gsusI commented 10 months ago

It's working beautifully 👌🏼🤖

gsusI commented 10 months ago

I celebrated too early, it seems.

https://github.com/getcursor/cursor/assets/4558016/927e5ae7-3bd8-4eef-b817-c4805051a6d1

Basically, when I have two overlapping inline edits, and the first one is done, the initial prompt automatically becomes a follow-up, changing the Call To Action from "Accept" to "Submit". I can still approve changes one by one. The second inline edit functions properly.

In my tests, the second prompt was consistently easier and faster than the first one, so it always finishes first; it could be that the issue affects to the inline editor that finishes last and not that starts first.