mrshmllow / document-color.nvim

🌈 LSP-based colorizer for neovim
MIT License
159 stars 3 forks source link

Invalid buffer id #3

Closed aspeddro closed 2 years ago

aspeddro commented 2 years ago

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>
mrshmllow commented 2 years ago

reproduction steps?

aspeddro commented 2 years ago

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