diff --git a/neovim/lua/plugins/lsp.lua b/neovim/lua/plugins/lsp.lua index eb6e1ef..5c53434 100644 --- a/neovim/lua/plugins/lsp.lua +++ b/neovim/lua/plugins/lsp.lua @@ -75,7 +75,9 @@ local function default_attach(client, bufnr) buf_set_keymap('n', 'q', 'lua vim.lsp.diagnostic.set_loclist()', opts) -- Open diagnostic on hold - vim.cmd [[autocmd CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})]] + if vim.diagnostic ~= nil then + vim.cmd [[autocmd CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})]] + end -- Set some keybinds conditional on server capabilities if client.resolved_capabilities.document_formatting then