fix vim.fn.sign_define deprecation and use vim.diagnostic.config.signs instead for neovim

This commit is contained in:
JesseBot 2025-08-20 19:14:30 +02:00
parent 2b0954001d
commit 4c12c73634
No known key found for this signature in database

View file

@ -156,17 +156,22 @@ lspconfig.yamlls.setup {
capabilities = capabilities
}
-- change the diagnostic signs to be nerdfonts
local signs = { Error = "", Warn = "", Hint = "", Info = "" }
for type, icon in pairs(signs) do
local hl = "DiagnosticSign" .. type
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
end
vim.diagnostic.config({
virtual_text = false,
signs = true,
signs = {
text = {
[vim.diagnostic.severity.ERROR] = '',
[vim.diagnostic.severity.WARN] = '',
[vim.diagnostic.severity.INFO] = '',
[vim.diagnostic.severity.HINT] = '',
},
linehl = {
[vim.diagnostic.severity.ERROR] = 'ErrorMsg',
},
numhl = {
[vim.diagnostic.severity.WARN] = 'WarningMsg',
},
},
underline = true,
update_in_insert = false,
severity_sort = false,