diff options
| author | Maria José Solano <majosolano99@gmail.com> | 2025-04-24 10:25:27 -0700 |
|---|---|---|
| committer | Christian Clason <ch.clason+github@icloud.com> | 2025-04-24 21:03:44 +0200 |
| commit | 8495d9623809eef5cf40b45ea3a5c2b0bd4077b5 (patch) | |
| tree | c09e784d2af8fd07cfb4761ec51f0a25e854d8b1 /runtime/lua/vim | |
| parent | 9ff12396347b0356b856b68b0e3010b3c8ec2e00 (diff) | |
| download | rneovim-8495d9623809eef5cf40b45ea3a5c2b0bd4077b5.tar.gz rneovim-8495d9623809eef5cf40b45ea3a5c2b0bd4077b5.tar.bz2 rneovim-8495d9623809eef5cf40b45ea3a5c2b0bd4077b5.zip | |
fix(lsp): ensure `bufstate` when calling `vim.lsp.document_color.is_enabled`
Diffstat (limited to 'runtime/lua/vim')
| -rw-r--r-- | runtime/lua/vim/lsp/document_color.lua | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/runtime/lua/vim/lsp/document_color.lua b/runtime/lua/vim/lsp/document_color.lua index b03055c233..c306acf696 100644 --- a/runtime/lua/vim/lsp/document_color.lua +++ b/runtime/lua/vim/lsp/document_color.lua @@ -238,7 +238,13 @@ end function M.is_enabled(bufnr) vim.validate('bufnr', bufnr, 'number', true) - return bufstates[vim._resolve_bufnr(bufnr)].enabled + bufnr = vim._resolve_bufnr(bufnr) + + if not bufstates[bufnr] then + reset_bufstate(bufnr, false) + end + + return bufstates[bufnr].enabled end --- Enables document highlighting from the given language client in the given buffer. |