make diagnostics open float on hold
This commit is contained in:
parent
a66ee46a7c
commit
cddf200122
@ -24,10 +24,8 @@ vim.diagnostic.config({
|
||||
},
|
||||
|
||||
float = {
|
||||
max_width = math.min(math.floor(vim.o.columns * 0.7), 100),
|
||||
max_height = math.min(math.floor(vim.o.lines * 0.3), 30),
|
||||
border = border_style,
|
||||
title = { { ' ', 'DiagnosticFloatTitleIcon' }, { 'Problems ', 'DiagnosticFloatTitle' } },
|
||||
title = { { 'lsp diagnostics', 'DiagnosticFloatTitleIcon' }, { 'Problems ', 'DiagnosticFloatTitle' } },
|
||||
focusable = false,
|
||||
scope = 'line',
|
||||
source = 'if_many',
|
||||
@ -39,6 +37,13 @@ vim.diagnostic.config({
|
||||
},
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
|
||||
group = vim.api.nvim_create_augroup("float_diagnostic", { clear = true }),
|
||||
callback = function ()
|
||||
vim.diagnostic.open_float()
|
||||
end
|
||||
})
|
||||
|
||||
for severity, icon in pairs(signs) do
|
||||
local hl = "DiagnosticSign" .. capitalize_head(vim.diagnostic.severity[severity])
|
||||
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
|
||||
|
@ -36,13 +36,6 @@ local handlers = {
|
||||
["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {border = border, focus = false}),
|
||||
}
|
||||
|
||||
-- vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
|
||||
-- group = vim.api.nvim_create_augroup("float_diagnostic", { clear = true }),
|
||||
-- callback = function ()
|
||||
-- vim.lsp.buf.hover(nil, {focus=false, scope='line'})
|
||||
-- end
|
||||
-- })
|
||||
|
||||
return {
|
||||
event={ "VeryLazy" },
|
||||
'neovim/nvim-lspconfig',
|
||||
|
Loading…
Reference in New Issue
Block a user