Ramilito / kubectl.nvim

Apache License 2.0
158 stars 4 forks source link

bug: Error executing vim.schedule lua callback #86

Closed idelice closed 1 month ago

idelice commented 1 month ago

Steps to produce

  1. toggle plugin on
  2. press "e" on pod
  3. close window
  4. press "enter" or "l" on pod

Error message

   Error  18:56:58 msg_show.lua_error Error executing vim.schedule lua callback: ...ce/projects/kubectl.nvim/lua/kubectl/actions/buffers.lua:19: Buffer is not 'modifiable'
stack traceback:
    [C]: in function 'nvim_buf_set_lines'
    ...ce/projects/kubectl.nvim/lua/kubectl/actions/buffers.lua:19: in function 'set_buffer_lines'
    ...ce/projects/kubectl.nvim/lua/kubectl/actions/buffers.lua:153: in function 'floating_buffer'
    ...ce/projects/kubectl.nvim/lua/kubectl/resourcebuilder.lua:155: in function 'displayFloat'
    ...ce/projects/kubectl.nvim/lua/kubectl/views/pods/init.lua:77: in function <...ce/projects/kubectl.nvim/lua/kubectl/views/pods/init.lua:72>
   Error  18:57:11 msg_show.lua_error Error executing vim.schedule lua callback: ...ce/projects/kubectl.nvim/lua/kubectl/actions/buffers.lua:19: Buffer is not 'modifiable'
stack traceback:
    [C]: in function 'nvim_buf_set_lines'
    ...ce/projects/kubectl.nvim/lua/kubectl/actions/buffers.lua:19: in function 'set_buffer_lines'
    ...ce/projects/kubectl.nvim/lua/kubectl/actions/buffers.lua:153: in function 'floating_buffer'
    ...ce/projects/kubectl.nvim/lua/kubectl/resourcebuilder.lua:155: in function 'displayFloat'
    ...jects/kubectl.nvim/lua/kubectl/views/containers/init.lua:23: in function <...jects/kubectl.nvim/lua/kubectl/views/containers/init.lua:17>
Ramilito commented 1 month ago

Seems that for some reason, running vim.fn.termopen in a floating buffer is not setting the terminal in focus but a weird in between where focus is on the floating buffer but not in the terminal resulting in "q" closing the floating buffer but not the terminal. Solved it by triggering a command to enter the terminal.