fix(lsp): check if diagnostics.signs is disabled by user (#2897)

This commit is contained in:
Iordanis Petkakis 2024-05-15 12:29:55 +03:00 committed by GitHub
parent 1892ebad78
commit 6a2545025e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -120,12 +120,14 @@ return {
-- diagnostics signs -- diagnostics signs
if vim.fn.has("nvim-0.10.0") == 0 then if vim.fn.has("nvim-0.10.0") == 0 then
if type(opts.diagnostics.signs) ~= "boolean" then
for severity, icon in pairs(opts.diagnostics.signs.text) do for severity, icon in pairs(opts.diagnostics.signs.text) do
local name = vim.diagnostic.severity[severity]:lower():gsub("^%l", string.upper) local name = vim.diagnostic.severity[severity]:lower():gsub("^%l", string.upper)
name = "DiagnosticSign" .. name name = "DiagnosticSign" .. name
vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" }) vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" })
end end
end end
end
-- inlay hints -- inlay hints
if opts.inlay_hints.enabled then if opts.inlay_hints.enabled then