Ramilito / kubectl.nvim

Apache License 2.0
165 stars 5 forks source link

errors when sorting and then changing NS #176

Closed mosheavni closed 1 month ago

mosheavni commented 1 month ago

Describe the bug When sorting by age, then changing namespace, there are a lot of errors popping: 2024-08-18_12-22-57 (1)

Error executing vim.schedule lua callback: /Users/mavni/Repos/kubectl.nvim/lua/kubectl/utils/marks.lua:60: Invalid 'col': out of range
stack traceback:
        [C]: in function 'nvim_buf_set_extmark'
        /Users/mavni/Repos/kubectl.nvim/lua/kubectl/utils/marks.lua:60: in function 'set_virtual_text_on_mark'
        /Users/mavni/Repos/kubectl.nvim/lua/kubectl/utils/marks.lua:50: in function 'set_sortby_header'
        ...mavni/Repos/kubectl.nvim/lua/kubectl/resourcebuilder.lua:317: in function <...mavni/Repos/kubectl.nvim/lua/kubectl/resourcebuilder.lua:316>

When sorting by name, an additional NAME column is added:

image

To Reproduce

  1. Open fresh neovim window
  2. Open Kubectl plugin
  3. Sort by age
  4. switch namespace
  5. errors pop
Ramilito commented 1 month ago

Nice catch!

I messed up forgetting about the width shifting when filtering/changing namespace, it should be fixed now!