nvim: lsp: Minor clean up of autocmd callbacks

This commit is contained in:
Sanchayan Maity 2022-09-09 17:06:19 +05:30
parent 108403ca3d
commit b398542a94

View file

@ -154,16 +154,12 @@ local on_attach = function(client, bufnr)
vim.api.nvim_create_autocmd({"CursorHold", "CursorHoldI", "InsertLeave"}, {
group = lsp_augroup_id,
buffer = bufnr,
callback = function ()
vim.lsp.codelens.refresh()
end,
callback = vim.lsp.codelens.refresh,
})
vim.api.nvim_create_autocmd({"CursorHold", "CursorHoldI"}, {
group = lsp_augroup_id,
buffer = bufnr,
callback = function ()
lightbulb.update_lightbulb()
end,
callback = lightbulb.update_lightbulb,
})
end
@ -171,16 +167,12 @@ local on_attach = function(client, bufnr)
vim.api.nvim_create_autocmd("CursorHold", {
group = lsp_augroup_id,
buffer = bufnr,
callback = function ()
vim.lsp.buf.document_highlight()
end,
callback = vim.lsp.buf.document_highlight,
})
vim.api.nvim_create_autocmd("CursorMoved", {
group = lsp_augroup_id,
buffer = bufnr,
callback = function ()
vim.lsp.buf.clear_references()
end,
callback = vim.lsp.buf.clear_references,
})
end
end