jackMort / ChatGPT.nvim

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

Can only open :ChatGPT once, breaks other plugins after executing command for second time #195

Closed HPRIOR closed 1 year ago

HPRIOR commented 1 year ago

After opening the chat prompt with :ChatGPT, the window opens fine and the plugin is working. After closing the window and executing the command again nothing happens. If I try to open another plugin, for example mason with :Mason, I get the error:

Error executing vim.schedule lua callback: ...are/nvimvimplug/mason.nvim/lua/mason-core/ui/display.lua:368: BufWinEnter Autocommands for "*": Vim(append):Error executing 
lua callback: Vim:E5300: Expected a Number or a String                                                                                                                    
stack traceback:                                                                                                                                                          
        [C]: in function 'bufwinid'                                                                                                                                       
        ...local/share/nvimvimplug/nui.nvim/lua/nui/layout/init.lua:88: in function <...local/share/nvimvimplug/nui.nvim/lua/nui/layout/init.lua:80>                      
        [C]: in function 'nvim_open_win'                                                                                                                                  
        ...are/nvimvimplug/mason.nvim/lua/mason-core/ui/display.lua:368: in function 'open'                                                                               
        ...are/nvimvimplug/mason.nvim/lua/mason-core/ui/display.lua:497: in function ''                                                                                   
        vim/_editor.lua: in function <vim/_editor.lua:0>                                                                                                                  
stack traceback:                                                                                                                                                          
        [C]: in function 'nvim_open_win'                                                                                                                                  
        ...are/nvimvimplug/mason.nvim/lua/mason-core/ui/display.lua:368: in function 'open'                                                                               
        ...are/nvimvimplug/mason.nvim/lua/mason-core/ui/display.lua:497: in function ''                                                                                   
        vim/_editor.lua: in function <vim/_editor.lua:0> 

This does not occur if I execute :ChatGPT once, and then do not attempt the command again.

I am using Plug to install the plugin, and calling setup early in the startup

mslawins commented 1 year ago

Same here. I'm using Paq as a package manager. Plugin was working fine mid April.

ariel-frischer commented 1 year ago

If I quit :ChatGPT by running :q! I get nothing when I run :ChatGPT again.

newvicklee commented 1 year ago

When the dialog is open, if you quit using <Ctrl-c>, then you can open it again, and it shouldn't break other plugins

Piotr1215 commented 1 year ago

When trying to quit with Ctrl-c there is an error: There is no checkhealth for this plugin. I'm running latest nvim stable

NVIM v0.9.1
Build type: Release
LuaJIT 2.1.0-beta3

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/__w/neovim/neovim/build/nvim.AppDir/usr/share/nvim"

Run :checkhealth for more info
E5108: Error executing lua: ...m/site/pack/packer/start/nui.nvim/lua/nui/popup/init.lua:161: BufWinLeave Autocommands for "<buffer=6>": Vim(mkview):E32: No file name
stack traceback:
        [C]: in function 'nvim_win_close'
        ...m/site/pack/packer/start/nui.nvim/lua/nui/popup/init.lua:161: in function '_close_window'
        ...m/site/pack/packer/start/nui.nvim/lua/nui/popup/init.lua:239: in function 'hide'
        ...site/pack/packer/start/nui.nvim/lua/nui/layout/float.lua:167: in function 'hide_box'
        .../site/pack/packer/start/nui.nvim/lua/nui/layout/init.lua:330: in function 'hide'
        ...acker/start/ChatGPT.nvim/lua/chatgpt/flows/chat/base.lua:803: in function 'hide'
        ...acker/start/ChatGPT.nvim/lua/chatgpt/flows/chat/base.lua:674: in function <...acker/start/ChatGPT.nvim/lua/chatgpt/flows/chat/base.lua:673>
jackMort commented 1 year ago

this error with closing by :q should be fixed now

HPRIOR commented 1 year ago

Thanks you, it's fixed. Thanks everyone else for the tips too

edmondburnett commented 6 months ago

This seems to have returned. After quitting the window and returning, I get:

Error executing Lua callback: .../.local/share/nvim/lazy/nui.nvim/lua/nui/layout/init.lua:258: BufWinEnter Autocommands for "*": Vim(append):Error executing lua callback: Vim:E5300: Expected a Number or a String
felipejoribeiro commented 5 months ago

i'm having the same problem, commit cbd2668, branch main on arch linux:

Peek 2024-03-21 01-52

It occurs both when i exit with the shortcut and :q, the error message is the following:

E5108: Error executing lua: ...i/.local/share/nvim/lazy/nui.nvim/lua/nui/popup/init.lua:189: BufWinLeave Autocommands for "<buffer=8>": Vim(mkview):E32: No file name
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'
        ...e/nvim/lazy/ChatGPT.nvim/lua/chatgpt/flows/chat/base.lua:1037: in function 'hide'
        ...e/nvim/lazy/ChatGPT.nvim/lua/chatgpt/flows/chat/base.lua:837: in function <...e/nvim/lazy/ChatGPT.nvim/lua/chatgpt/flows/chat/base.lua:836>

Thank you for the great plugin, i hope this report will help you make this great extension even better.