jackMort / ChatGPT.nvim

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

Attempt # 2 to fix #352 #390

Closed Aaronik closed 4 months ago

Aaronik commented 5 months ago

@jackMort @Moerliy here's another fix that fixes this bug in all invocations of the window, not just the first one, which yesterday's fix addressed.

It also renames one local variable for clarity.


The previous fix (#388) worked only for the first time the edit with instructions window was opened.

Now it works every time it's opened (at least up to however many times I tested it. Theoretically it could fail on the 10,000th time.)

Moerliy commented 4 months ago

Looks good to me. I have no running instance of nvim currently tho. So I haven't tested it locally.

v3ceban commented 4 months ago

Thanks so much for working on it!

The bug also seems to be present in Optimize and Summarize windows (perhaps other windows too if there are more that I'm unaware of)

Aaronik commented 4 months ago

@v3ceban this seems to fix those as well, if my testing is correct. Can you test it out as well?

v3ceban commented 4 months ago

@Aaronik indeed, this pr solves the problem in other windows/popups too. Tested on Fedora 39 (x86_64) and Android/Termux (arm). Thanks for your contribution <3 Hope to see this merged soon!

Moerliy commented 4 months ago

Works on:

too.

Aaronik commented 4 months ago

@jackMort think this passes muster?

Aaronik commented 4 months ago

@jackMort if there's anything wrong with this, please let me know and I'll change it up :+1: