I’m currently doing something like this with the handlers.
-- Hover rounded borders with transparent background
local function customise_handler(handler)
local overrides = { border = "rounded" }
return vim.lsp.with(function(...)
local _, winnr = handler(...)
if winnr then
vim.api.nvim_win_set_option(winnr, "winblend", 20)
end
end, overrides)
end
vim.lsp.handlers["textDocument/hover"] = customise_handler(vim.lsp.handlers.hover)
vim.lsp.handlers["textDocument/signatureHelp"] = customise_handler(vim.lsp.handlers.signature_help)
I would like to do something similar with vim.diagnostic.open_float
, but cannot find a handler for this. The best I can do so far is to bind the following function in the keymap for vim.diagnostic.open_float
. Just wondering if there is a better way to do this.
function ()
local _, winnr = vim.diagnostic.open_float({ border = "rounded" })
if winnr then
vim.api.nvim_win_set_option(winnr, "winblend", 20)
end
end