BUG?: Insert at Cursor when Text is selected

I dont know if this is a bug, but when i press “insert Code at Cursor” he code will be pasted over the selected area. Whouldnt it be better when its overwrite the selected Text?

1 Like

@SphaeroX thanks for sharing and adding a screenshot.

I will share this with the product team and follow up.

1 Like

Hey @SphaeroX what version of Cody are you running? I’m unable to replicate this on v1.16.2.

Please include the OS & VS Code version.

Cody AI v1.17.1715181252 (pre-release)

VSCode:
Version: 1.89.0 (user setup)
Commit: b58957e67ee1e712cebf466b995adf4c5307b2bd
Datum: 2024-05-01T02:09:22.859Z
Electron: 28.2.8
ElectronBuildId: 27744544
Chromium: 120.0.6099.291
Node.js: 18.18.2
V8: 12.0.267.19-electron.0
Betriebssystem: Windows_NT x64 10.0.22631

1 Like

Ah got it. I will get some eyes on this.

Can you try the Edit code command in the mean time? For Windows I believe it is alt+k

Try this:

this one works fine

I see the same behavior using v5.5.9 of the Jetbrains plugin. I highlight code that I want to replace but it is not overwritten when I click “Insert at cursor.” The plugin does exactly what it says and inserts the code, leaving the original code intact.

1 Like

@mdhender v5.5.10 is now available. Can you try it now?

I upgraded to 5.5.10, restarted the JB IDE. Highlight code, click the Insert at Cursor and the new code from the chat is inserted above what I highlighted. It’s not replacing it. It still leaves the selection highlighted.

Screenshot 2024-05-14 at 11.59.58 AM

1 Like

Got it, thanks for the heads up. Going to send to our JetBrains team now.

Their response:

“This is expected behavior, but it’s useful feedback that users expect “insert at cursor” to replace code that’s highlighted (not just insert the new code).”

1 Like