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

Exiting any window causes 'ChatGPT' to throw errors #422

Open felipejoribeiro opened 3 months ago

felipejoribeiro commented 3 months ago

Great Plugin!

Context:

branch main commit df53728

-- config
return {
  'jackMort/ChatGPT.nvim',
  event = 'VeryLazy',
  config = function()
    require('chatgpt').setup()
  end,
  dependencies = {
    'MunifTanjim/nui.nvim',
    'nvim-lua/plenary.nvim',
    'folke/trouble.nvim',
    'nvim-telescope/telescope.nvim',
  },
}

I'm having an issue when exiting the prompt window:

image

Error detected while processing WinClosed Autocommands for "1006":
Error executing lua callback: ...i/.local/share/nvim/lazy/nui.nvim/lua/nui/popup/init.lua:189: WinCl
osed Autocommands for "1006"..BufWinLeave Autocommands for "<buffer=8>": Vim(mkview):E32: No file na
me
stack traceback:
        [C]: in function 'nvim_win_close'
        ...i/.local/share/nvim/lazy/nui.nvim/lua/nui/popup/init.lua:189: in function '_close_window'

        ...i/.local/share/nvim/lazy/nui.nvim/lua/nui/popup/init.lua:268: in function 'hide'
        ....local/share/nvim/lazy/nui.nvim/lua/nui/layout/float.lua:175: in function 'hide_box'
        .../.local/share/nvim/lazy/nui.nvim/lua/nui/layout/init.lua:364: in function 'hide'
        .../.local/share/nvim/lazy/nui.nvim/lua/nui/layout/init.lua:119: in function <.../.local/sha
re/nvim/lazy/nui.nvim/lua/nui/layout/init.lua:118>

It happens when i'm inside the prompt window of "ChatGPT", and i close it with :q, it leaves a black opaque square behind as well as follows:

image

When i exit with <C-c> the behavior is almost the same, but the 'prompt' window stays behind and i have to quit it with :q because the former way doesn't work anymore.

Thanks for the amazing plugin.