Bryley / neoai.nvim

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

Lua error after closing chat buffer window #34

Closed academo closed 10 months ago

academo commented 1 year ago

Version: https://github.com/Bryley/neoai.nvim/commit/14ffe5f1361bdfbd7667ca57cb07f52abcdcc00b

If I open a context window and close it with :q instead of the :NeoAiContextClose the buffer closes as normal but a few seconds later this error appears

Error executing vim.schedule lua callback: ...local/share/nvim/lazy/neoai.nvim/lua/neoai/chat/init.lua:98: attempt to index field 'chat_history' (a nil value)
stack traceback:
        ...local/share/nvim/lazy/neoai.nvim/lua/neoai/chat/init.lua:98: in function 'on_complete'
        ...re/nvim/lazy/neoai.nvim/lua/neoai/chat/models/openai.lua:87: in function 'on_complete'
        ...mo/.local/share/nvim/lazy/neoai.nvim/lua/neoai/utils.lua:66: in function <...mo/.local/share/nvim/lazy/neoai.nvim/lua/neoai/utils.lua:62>