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

GpChatNew popup's can't be closed with GpChatToggle popup (at least not with first try) #112

Closed rqpt closed 4 months ago

rqpt commented 4 months ago

Expected: I do a 'GpChatNew popup', I get my floating window, and am able to immediately close the window with 'GpChatToggle popup'.

Actual: I do a 'GpChatNew popup', I get my floating window, and I need to do 'GpChatToggle popup' twice before the window closes.

Replication steps:

  1. Copy/Paste my config.
  2. Do 'leader leader n' to open a new chat popup.
  3. Try 'leader leader t' to toggle the popup off.
  4. Try 'leader leader t' again.
  5. Success!
  6. Be frustrated, because you ran into this issue for the millionth time now x'(.

My config (lazy):

  {
    "robitx/gp.nvim",
    keys = {
      { "<leader><leader>n", "<cmd>GpChatNew popup<cr><cmd>set rnu<cr>" },
      { "<leader><leader>t", "<cmd>GpChatToggle popup<cr><cmd>set rnu<cr>" },
      { "<leader><leader>r", "<cmd>GpChatRespond<cr>" },
      { "<leader><leader>f", "<cmd>GpChatFinder<cr>" },
      { "<leader><leader>d", "<cmd>GpChatDelete<cr>" },

      { "<leader><leader>c", "<cmd>GpRewrite<cr>" },
      { "<leader><leader>o", "<cmd>GpAppend<cr>" },
      { "<leader><leader>O", "<cmd>GpPrepend<cr>" },

      { "<leader><leader>p", ":<C-u>'<,'>GpChatPaste popup<cr><cmd>set rnu<cr>", mode = { "v" } },
      { "<leader><leader>n", ":<C-u>'<,'>GpChatNew popup<cr><cmd>set rnu<cr>",   mode = { "v" } },
      { "<leader><leader>c", ":<C-u>'<,'>GpRewrite<cr>",                         mode = { "v" } },
      { "<leader><leader>o", ":<C-u>'<,'>GpAppend<cr>",                          mode = { "v" } },
      { "<leader><leader>O", ":<C-u>'<,'>GpPrepend<cr>",                         mode = { "v" } },
    },
    config = function()
      require("gp").setup()
    end,
  },