jackMort / ChatGPT.nvim

ChatGPT Neovim Plugin: Effortless Natural Language Generation with OpenAI's ChatGPT API
Apache License 2.0
3.64k stars 312 forks source link

ChatGPTEditwithInstructions strange behavior #240

Open Dranaxel opened 1 year ago

Dranaxel commented 1 year ago

Hi, First of all thanks for this plugin that only begins to change the way I write code 🙏

I'm getting to use edit with instruction more and more and I encountered a strange behavior: sometime the code displayed on the left is not my full code. Sometimes it's a good thing, sometimes les... Is this a bug or a feature ? If the second, is there a way to select which code to use ? Thanks

Zolmok commented 1 year ago

I'm seeing this as well. For example I put my cursor at the beginning of a function thinking it will pull in the entire function but often it just pulls in some random lines from the function.

Dranaxel commented 1 year ago

The more I use, the more i'm thinking this is a feature. Select a part of a text then exit so you can apply your prompt on this part only.

jaywhy13 commented 11 months ago

This happened with me as well. I wasn't selecting text. It randomly picks up only a few lines from my code, and it will do it repeatedly even if I close the window and run the command again.

danielo515 commented 7 months ago

This seems to be some state problem. For example, if I go to the bottom of my file, and just run edit with instructions, the first time it will select the whole file as input, exactly what I wanted. From there, every time I run the same command it only picks some random lines, sometimes the very first line, some times some other lines. Not sure what makes this happen, but if I restart neovim it starts to work again as expected