local helpers = {} function helpers.diagnostic_on_cursor_hold(bufnr) vim.api.nvim_create_autocmd("CursorHold", { buffer = bufnr, callback = function() local opts = { focusable = false, close_events = { "BufLeave", "CursorMoved", "InsertEnter", "FocusLost" }, border = 'rounded', source = 'always', prefix = ' ', scope = 'cursor', } vim.diagnostic.open_float(nil, opts) end }) end return helpers