Robitx / gp.nvim

Gp.nvim (GPT prompt) Neovim AI plugin: ChatGPT sessions & Instructable text/code operations & Speech to text [OpenAI]
MIT License
537 stars 49 forks source link

BUG: cant' stop saving after runing `GpChatNew` #100

Closed XXiaoA closed 5 months ago

XXiaoA commented 5 months ago

with all default configuration

https://github.com/Robitx/gp.nvim/assets/62557596/f4f43491-2e9e-4047-a28b-e716ec4349db

XXiaoA commented 5 months ago

Okay, I think I figure where the bug is out... In this line
https://github.com/Robitx/gp.nvim/blob/607f94d361f36b8eabb148d95993604fdd74d901/lua/gp/init.lua#L1370 we call the function to imitate we hit the <ESC> key after event BufEnter.

Meanwhile, I have this keymap

nmap("<ESC>", "<CMD>w|e|redraw<CR>")

which do a lot including reenter the buffer. So we are trapped in an endless loop.... 😢

XXiaoA commented 5 months ago

I made a PR to resolve the bug