deprecated function

This commit is contained in:
Oliver Hartmann 2025-03-26 21:06:48 +01:00
parent 9c904b2f84
commit 028ca26b08
2 changed files with 29 additions and 23 deletions

View File

@ -109,14 +109,36 @@ opt.foldexpr = 'nvim_treesitter#foldexpr()'
opt.foldexpr = 'nvim_treesitter#foldexpr()' opt.foldexpr = 'nvim_treesitter#foldexpr()'
vim.diagnostic.config({ vim.diagnostic.config({
virtual_text = false, signs = {
signs = true, text = {
float = { [vim.diagnostic.severity.ERROR] = '', -- Nerd Font Error Icon
border = 'single', [vim.diagnostic.severity.WARN] = '', -- Nerd Font Warning Icon
format = function(diagnostic) [vim.diagnostic.severity.INFO] = '', -- Nerd Font Info Icon
return string.format('%s (%s) [%s]', diagnostic.message, diagnostic.source, diagnostic.code or diagnostic.user_data.lsp.code) [vim.diagnostic.severity.HINT] = '', -- Nerd Font Hint Icon (example)
end, },
-- Define the highlight group to use for the sign text for each severity
texthl = {
[vim.diagnostic.severity.ERROR] = 'DiagnosticSignError',
[vim.diagnostic.severity.WARN] = 'DiagnosticSignWarn',
[vim.diagnostic.severity.INFO] = 'DiagnosticSignInfo',
[vim.diagnostic.severity.HINT] = 'DiagnosticSignHint',
},
-- Optional: Highlight the line number column
numhl = {
[vim.diagnostic.severity.ERROR] = 'DiagnosticLineNrError',
-- Add others for WARN, INFO, HINT if desired
},
-- Optional: Highlight the whole line
linehl = {
-- Define highlight groups like 'DiagnosticLineError', 'DiagnosticLineWarn', etc.
[vim.diagnostic.severity.ERROR] = 'DiagnosticLineError',
},
}, },
-- Other diagnostic configurations (optional examples)
virtual_text = false, -- Disable virtual text (inline messages)
underline = true, -- Enable underlining diagnostics
update_in_insert = false, -- Don't update diagnostics in insert mode
severity_sort = true, -- Sort diagnostics by severity
}) })
-- Window border for floating windows -- Window border for floating windows

View File

@ -116,23 +116,7 @@ return {
}, },
} }
local diagnostics = {
Error = '',
Warning = '',
Information = '',
Question = '',
Hint = '',
}
local signs = {
{ name = 'DiagnosticSignError', text = diagnostics.Error },
{ name = 'DiagnosticSignWarn', text = diagnostics.Warning },
{ name = 'DiagnosticSignHint', text = diagnostics.Hint },
{ name = 'DiagnosticSignInfo', text = diagnostics.Information },
}
for _, sign in ipairs(signs) do
vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = sign.name })
end
OpenDiagFloat = function() OpenDiagFloat = function()
for _, winid in pairs(vim.api.nvim_tabpage_list_wins(0)) do for _, winid in pairs(vim.api.nvim_tabpage_list_wins(0)) do