From fca26b05699ad06c077721823a0b1a8e02539d5c Mon Sep 17 00:00:00 2001 From: Tzu-Yu Lee Date: Sat, 15 Jun 2024 03:34:12 +0000 Subject: [PATCH] fix: limit codelens refresh to current buffer (#476) The behavior of `vim.lsp.codelens.refresh()` had been changed in https://github.com/neovim/neovim/pull/27253 to refresh all open buffers. This changes the function calls to specify the current buffer to maintain the old behavior. Fixes https://github.com/ray-x/go.nvim/issues/472. --- lua/go/codelens.lua | 2 +- lua/go/lsp.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/go/codelens.lua b/lua/go/codelens.lua index ed4b460..6428ea2 100644 --- a/lua/go/codelens.lua +++ b/lua/go/codelens.lua @@ -53,7 +53,7 @@ function M.refresh() return end if _GO_NVIM_CFG.lsp_codelens == true then - vim.lsp.codelens.refresh() + vim.lsp.codelens.refresh({ bufnr = 0 }) else log('refresh codelens') vim.lsp.codelens.clear() diff --git a/lua/go/lsp.lua b/lua/go/lsp.lua index cf66bef..bcdd6ef 100644 --- a/lua/go/lsp.lua +++ b/lua/go/lsp.lua @@ -39,7 +39,7 @@ local on_attach = function(client, bufnr) end if _GO_NVIM_CFG.lsp_codelens then - vim.lsp.codelens.refresh() + vim.lsp.codelens.refresh({ bufnr = 0 }) end local keymaps if _GO_NVIM_CFG.lsp_keymaps == true then