1
0
mirror of https://github.com/jdhao/nvim-config.git synced 2025-06-08 14:14:33 +02:00

Fix diagnostic window auto-focus issue.

This commit is contained in:
jdhao 2021-06-15 13:06:12 +08:00 committed by GitHub
parent 4bb84024eb
commit 2d7d48ad25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,7 +24,7 @@ local on_attach = function(client, bufnr)
buf_set_keymap('n', '<space>q', '<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>', opts)
-- Show diagnostic automatically when cursor is on hold.
vim.api.nvim_command('autocmd CursorHold <buffer> lua vim.lsp.diagnostic.show_line_diagnostics()')
vim.api.nvim_command('autocmd CursorHold <buffer> lua vim.lsp.diagnostic.show_line_diagnostics({focusable=False})')
-- Set some keybinds conditional on server capabilities
if client.resolved_capabilities.document_formatting then