mrshmllow/document-color.nvim

Invalid buffer id

Closed this issue · 2 comments

Using: sumneko_lua

Error executing vim.schedule lua callback: .../packer/start/document-color.nvim/lua/document-color.lua:59: Invalid buffer id: 1
stack traceback:
        [C]: in function 'nvim_buf_clear_namespace'
        .../packer/start/document-color.nvim/lua/document-color.lua:59: in function 'handler'
        /usr/share/nvim/runtime/lua/vim/lsp.lua:1025: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>
Error executing vim.schedule lua callback: .../packer/start/document-color.nvim/lua/document-color.lua:59: Invalid buffer id: 17
stack traceback:
        [C]: in function 'nvim_buf_clear_namespace'
        .../packer/start/document-color.nvim/lua/document-color.lua:59: in function 'handler'
        /usr/share/nvim/runtime/lua/vim/lsp.lua:1025: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>

reproduction steps?

can't play it now.

This is because some servers take time to attach, request and apply highlighting. If in this interval the buffer is deleted then it is invalid.

Example using sumneko_lua with emmylua-nvim

  1. Open a file and close :bd before attach