Skip to content

Commit

Permalink
fix(nvim): Update diagnostics signs config
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjones2014 committed May 30, 2024
1 parent 2e76a65 commit e11638b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
4 changes: 2 additions & 2 deletions nvim/lua/my/configure/heirline/shared.lua
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ function M.Diagnostics(is_winbar, bg)
:map(function(severity)
local component = {
provider = function(self)
local sign = vim.fn.sign_getdefined('DiagnosticSign' .. severity_name[severity])[1]
return string.format('%s%s ', sign and sign.text, self.counts[severity] or 0)
local sign = vim.diagnostic.config().signs.text[severity]
return string.format('%s%s ', sign, self.counts[severity] or 0)
end,
hl = function()
return { fg = utils.get_highlight(string.format('DiagnosticSign%s', severity_name[severity])).fg, bg = bg }
Expand Down
2 changes: 1 addition & 1 deletion nvim/lua/my/configure/heirline/statuscolumn.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ M.DiagnosticSign = {
-- only show the highest severity sign
if diagnostics and #diagnostics > 0 then
self.has_sign = true
self.sign = vim.fn.sign_getdefined('DiagnosticSign' .. severity_name[diagnostics[1].severity])[1]
self.sign = vim.diagnostic.config().signs.text[diagnostics[1].severity]
end
end,
provider = function(self)
Expand Down
6 changes: 1 addition & 5 deletions nvim/lua/my/utils/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ function M.apply_ui_tweaks()
Hint = '',
Info = '',
}
for type, icon in pairs(icons) do
local highlight = 'DiagnosticSign' .. type
vim.fn.sign_define(highlight, { text = icon, texthl = highlight, numhl = highlight })
end

local icon_map = {
[vim.diagnostic.severity.ERROR] = icons.Error,
Expand All @@ -72,7 +68,7 @@ function M.apply_ui_tweaks()
float = {
format = diagnostic_format,
},
signs = { priority = 100 },
signs = { priority = 100, text = icon_map },
underline = true,
update_in_insert = false,
severity_sort = true,
Expand Down

0 comments on commit e11638b

Please sign in to comment.