nvim-lualine / lualine.nvim

A blazing fast and easy to configure neovim statusline plugin written in pure lua.
MIT License
6.16k stars 465 forks source link

Looks like diagnostics module's icons can't be customized #720

Closed graelo closed 2 years ago

graelo commented 2 years ago

Thanks a lot from this awesome plugin.

Self Checks

How to reproduce the problem

I've successfully customized other modules (such as branch and filename), but I'm failing at configuring the diagnostics icons. I tried:

{
  'diagnostics',
    icons_enabled = true,
    -- symbols = {    -- I tried with and without this wrapping
    icons = {
      error = '', -- xf659, shows up in my terminal
      warn = '',  -- xf529, idem
      info = '',  -- xf7fc, idem
      hint = '⚡',  -- xf835, idem
    }
    -- }
}

I checked that setting icons_enabled = false results in the text equivalents being shown, so I guess my config is not completely south.

I'm a lua newbie, but I suspect in this code the customized icons are always overridden by the default ones or text replacements. https://github.com/nvim-lualine/lualine.nvim/blob/master/lua/lualine/components/diagnostics/init.lua#L25-L30

Expected behaviour

I would expect my custom icons to be displayed instead of the default ones.

Actual behaviour

The default icons are always displayed.

Minimal config to reproduce the issue

Config Sorry, I'll first try posting this issue without doing this intimidating task. I'll do it if you really want it to solve this issue, but my guess is that the initialization code has a small issue.

Additional information

shadmansaleh commented 2 years ago

The docs says

{
  'diagnostics',
      symbols = {
      error = '', -- xf659, shows up in my terminal
      warn = '',  -- xf529, idem
      info = '',  -- xf7fc, idem
      hint = '⚡',  -- xf835, idem
    }
}

did you try that ? there's no icons table rather it's symbols.

graelo commented 2 years ago

No, I missed this. It's working now, thanks!