nvim: lsp: Minor clean up of autocmd callbacks
This commit is contained in:
parent
108403ca3d
commit
b398542a94
1 changed files with 12 additions and 20 deletions
|
@ -154,16 +154,12 @@ local on_attach = function(client, bufnr)
|
||||||
vim.api.nvim_create_autocmd({"CursorHold", "CursorHoldI", "InsertLeave"}, {
|
vim.api.nvim_create_autocmd({"CursorHold", "CursorHoldI", "InsertLeave"}, {
|
||||||
group = lsp_augroup_id,
|
group = lsp_augroup_id,
|
||||||
buffer = bufnr,
|
buffer = bufnr,
|
||||||
callback = function ()
|
callback = vim.lsp.codelens.refresh,
|
||||||
vim.lsp.codelens.refresh()
|
|
||||||
end,
|
|
||||||
})
|
})
|
||||||
vim.api.nvim_create_autocmd({"CursorHold", "CursorHoldI"}, {
|
vim.api.nvim_create_autocmd({"CursorHold", "CursorHoldI"}, {
|
||||||
group = lsp_augroup_id,
|
group = lsp_augroup_id,
|
||||||
buffer = bufnr,
|
buffer = bufnr,
|
||||||
callback = function ()
|
callback = lightbulb.update_lightbulb,
|
||||||
lightbulb.update_lightbulb()
|
|
||||||
end,
|
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -171,16 +167,12 @@ local on_attach = function(client, bufnr)
|
||||||
vim.api.nvim_create_autocmd("CursorHold", {
|
vim.api.nvim_create_autocmd("CursorHold", {
|
||||||
group = lsp_augroup_id,
|
group = lsp_augroup_id,
|
||||||
buffer = bufnr,
|
buffer = bufnr,
|
||||||
callback = function ()
|
callback = vim.lsp.buf.document_highlight,
|
||||||
vim.lsp.buf.document_highlight()
|
|
||||||
end,
|
|
||||||
})
|
})
|
||||||
vim.api.nvim_create_autocmd("CursorMoved", {
|
vim.api.nvim_create_autocmd("CursorMoved", {
|
||||||
group = lsp_augroup_id,
|
group = lsp_augroup_id,
|
||||||
buffer = bufnr,
|
buffer = bufnr,
|
||||||
callback = function ()
|
callback = vim.lsp.buf.clear_references,
|
||||||
vim.lsp.buf.clear_references()
|
|
||||||
end,
|
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue