Don't error when trying to handle older diagnostic api

This commit is contained in:
ViViDboarder 2021-12-15 08:32:19 -08:00
parent 83590865a5
commit c6e7e756d0

View File

@ -75,7 +75,7 @@ local function default_attach(client, bufnr)
buf_set_keymap('n', '<leader>q', '<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>', opts)
-- Open diagnostic on hold
if vim.diagnostic ~= nil then
if vim["diagnostic"] ~= nil then
vim.cmd [[autocmd CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})]]
end