RRethy / vim-illuminate

illuminate.vim - (Neo)Vim plugin for automatically highlighting other uses of the word under the cursor using either LSP, Tree-sitter, or regex matching.
2.14k stars 47 forks source link

Make sure buffer is loaded before handling results #98

Closed jose-elias-alvarez closed 2 years ago

jose-elias-alvarez commented 2 years ago

Loading and unloading a buffer before documentHighlight results are returned causes vim.lsp.util.buf_clear_references to throw an error. This PR adds an additional check to make sure the buffer is loaded before attempting to handle results.

RRethy commented 2 years ago

Thanks, I made a small styling change, included you in the commit for credit.