mattn / vim-chatgpt

94 stars 8 forks source link

Add support for Neovim #4

Open zalgo3 opened 1 year ago

zalgo3 commented 1 year ago

This commit adds support for Neovim's job API.

nbossard commented 1 year ago

@zalgo3 Gave a try to your branch with neovim v0.8.2 typed :

:ChatGPT Hello

and got :

Erreur détectée en traitant function <SNR>254_nvim_chatgpt_cb_out :
ligne    1 :
E474: Trailing characters: {"eof":false,"error":"","text":"Sal"}^@{"eof":false,"error":"","text":"ut"}^@{"eof":false,"error":"","text":"!"}^@

Made the same test with vim, worked fine. any idea why ?

zalgo3 commented 1 year ago

@nbossard

Thanks, it seems that s:nvim_chatgpt_cb_out was not correctly handling a list consisting of multiple JSON strings. I fixed it in https://github.com/mattn/vim-chatgpt/pull/4/commits/d94ed0d28582ad728fb60af5149c2f19c2205229.

mattn commented 1 year ago

Can you make new function for the common part for Vim and Neovim?

nbossard commented 1 year ago

@nbossard

Thanks, it seems that s:nvim_chatgpt_cb_out was not correctly handling a list consisting of multiple JSON strings. I fixed it in d94ed0d.

Ok gave it a try works fine now

zalgo3 commented 1 year ago

@mattn

Can you make new function for the common part for Vim and Neovim?

Thank you. Refactored in https://github.com/mattn/vim-chatgpt/pull/4/commits/7f21286727f5a7155503629534b6f4d3c451bd0f

mattn commented 1 year ago

Looks good.