Ramilito / kubectl.nvim

Apache License 2.0
165 stars 5 forks source link

Mapping exit to 'q' causes plugin to crash after entering resource #165

Closed rafi closed 4 weeks ago

rafi commented 4 weeks ago

Describe the bug Use following setup with lazy.nvim:

    {
        'ramilito/kubectl.nvim',
        keys = {
            { '<leader>8', function() vim.cmd[[tabnew]]; require('kubectl').open() end, desc = 'Kubectl' },
        },
        opts = {
            mappings = {
                exit = 'q',
            },
        },
    },

To Reproduce

  1. Open with Leader8
  2. Press Return on one of the resources
  3. Press q

Error:

curl: (7) Failed to connect to 127.0.0.1 port 51069 after 0 ms: Couldn't connect to server

Environment

Ramilito commented 4 weeks ago

Thank you for reporting this issue!

We do some cleaning up when triggering the exit mapping that shouldn't be done when closing a floating buffer, added a check in #166 to avoid stopping the kubectl proxy if we are close on a floating buffer

rafi commented 4 weeks ago

That was really fast :) works great!

Ramilito commented 4 weeks ago

Couldn't have done it so fast without the excellent issue description!