Bryley / neoai.nvim

Neovim plugin for intracting with GPT models from OpenAI
MIT License
566 stars 51 forks source link

Error when closing NeoAI while it is outputting #4

Closed DanielVolchek closed 1 year ago

DanielVolchek commented 1 year ago

If you close the NeoAI gui while it is outputting anything, you get a long string of errors

Error executing vim.schedule lua callback: .../nvim/site/pack/packer/start/neoai.nvim/lua/neoai/ui.lua:190: Expected Lua number
stack traceback:
        [C]: in function 'nvim_buf_get_lines'
        .../nvim/site/pack/packer/start/neoai.nvim/lua/neoai/ui.lua:190: in function 'append_to_output'
        ...ite/pack/packer/start/neoai.nvim/lua/neoai/chat/init.lua:83: in function 'on_stdout_chunk'
        ...packer/start/neoai.nvim/lua/neoai/chat/models/openai.lua:43: in function 'recieve_chunk'
        ...packer/start/neoai.nvim/lua/neoai/chat/models/openai.lua:73: in function 'on_stdout_chunk'
        ...im/site/pack/packer/start/neoai.nvim/lua/neoai/utils.lua:39: in function <...im/site/pack/packer/start/neoai.nvim/lua/neoai/u
tils.lua:38>
Bryley commented 1 year ago

Thanks for the feedback. This should now be fixed in the latest commit :+1: