neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 96b94f8d77774e3dabdec48bba2b56246a3ccba8
parent ca5de9306c00d07cce1daef1f0038c937098bc66
Author: Chinmay Dalal <dalal.chinmay.0101@gmail.com>
Date:   Tue, 20 Jun 2023 15:06:06 +0530

fix(lsp): duplicate on_detach, on_reload callbacks #24067

M.enable already clears bufstate[bufnr] and the namespace,
the duplicate callbacks cause an error (indexing bufstate[bufnr] fails)
Diffstat:
Mruntime/lua/vim/lsp/_inlay_hint.lua | 12------------
1 file changed, 0 insertions(+), 12 deletions(-)

diff --git a/runtime/lua/vim/lsp/_inlay_hint.lua b/runtime/lua/vim/lsp/_inlay_hint.lua @@ -48,18 +48,6 @@ function M.on_inlayhint(err, result, ctx, _) if not (bufstate.client_hint and bufstate.version) then bufstate.client_hint = vim.defaulttable() bufstate.version = ctx.version - api.nvim_buf_attach(bufnr, false, { - on_detach = function(_, cb_bufnr) - api.nvim_buf_clear_namespace(cb_bufnr, namespace, 0, -1) - bufstates[cb_bufnr].version = nil - bufstates[cb_bufnr].client_hint = nil - end, - on_reload = function(_, cb_bufnr) - api.nvim_buf_clear_namespace(cb_bufnr, namespace, 0, -1) - bufstates[cb_bufnr].version = nil - bufstates[cb_bufnr].client_hint = nil - end, - }) end local hints_by_client = bufstate.client_hint local client = vim.lsp.get_client_by_id(client_id)