diff --git a/lua/astronvim/utils/lsp.lua b/lua/astronvim/utils/lsp.lua index d798adcf96a..da8a1fccf7f 100644 --- a/lua/astronvim/utils/lsp.lua +++ b/lua/astronvim/utils/lsp.lua @@ -253,7 +253,7 @@ M.on_attach = function(client, bufnr) end, }, { - events = { "CursorMoved", "CursorMovedI" }, + events = { "CursorMoved", "CursorMovedI", "BufLeave" }, desc = "clear references when cursor moves", callback = function() vim.lsp.buf.clear_references() end, },