fix: Add group to autocmd (to be able to clear it)

Also added some nice border style to the diagnostics pop-up.
This commit is contained in:
Dionisio E Alonso 2022-08-08 11:50:07 -03:00
parent 82697ea146
commit 8af69b9d0a
1 changed files with 5 additions and 0 deletions

View File

@ -46,7 +46,12 @@ lua << EOF
local nvim_lsp = require("lspconfig")
local on_attach = function(client, bufnr)
vim.diagnostic.config({
float = { border = "rounded" }
})
vim.api.nvim_create_autocmd("CursorHoldI", {
group = vim.api.nvim_create_augroup("Diagnostics", { clear = true }),
buffer = bufnr,
callback = function()
vim.diagnostic.open_float({ focusable = false, header = "" })