ChatGPT.nvim
ChatGPT.nvim copied to clipboard
stuck on processing - adding possible reset or clear command
I recently ran into issues like
- "invalid capture index"
- or i accidentally used the whole buffer for a request
- or my internet reception was bad and the request couldn't go through 100%
When either of those happens, then the "processing, please wait ... " overlay stays int the buffer as well as the gray background. Closing the buffer and reopening does not solve this issue C-x does not either.
Anyhow in those cases something like a :ChatGPTRun clear_requests or just reset command would be useful, to basically reset the plugin and remove all overlays...
Or maybe i'am missing another fix how to do this?
+1 It is very annoying when this happens. I've tried below 2 approaches to unload the package hoping ChatGPT would restart. no luck :(
- package.loaded["chatgpt"] = nil
- require 'plenary.reload'.reload_module('chatgpt')
Yes I would add that the command I passed to get the api key (1password's op command) requires user input and in that case the message "processing, please wait..." is stuck Also it happens extremely frequently for whatever reason that simple requests fail. In that case too the message is stuck. Right now I just commented out the function BaseAction:render_spinner(state) function (and in lazy I point to the forked version with "{ dir = "~/code/forks/ChatGPT.nvim" }"). Hopefully someone with better understanding fix this bug otherwise maybe I'll do it. My guess is that the code to clean the loading message is not called in case of API failure.
Related to @belafonte's problem with "invalid capture index" I have provided a PR which solves the issue for me and might solve it for him/her too (https://github.com/jackMort/ChatGPT.nvim/pull/409)