nvim-lualine / lualine.nvim

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

Bug: the warning color does not displayed correctly. #461

Closed mt1ger closed 2 years ago

mt1ger commented 2 years ago

Self Checks

How to reproduce the problem

Expected behaviour

The warning icon should be some colors in the yellow region.

Actual behaviour

The warning icon is dark. image

Minimal config to reproduce the issue

call plug#begin('~/.vim/plugged')

Plug 'sainnhe/gruvbox-material', {'frozen': 1}
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'nvim-lualine/lualine.nvim'

call plug#end()

colorscheme gruvbox-material 
set background=dark
let g:gruvbox_invert_selection='0'

lua << EOF
require('lualine').setup {
    options = {
        theme = 'gruvbox-material',
        section_separators = {'', ''},
        component_separators = {'|', '|'}
    },
    sections = {
        lualine_a = {'mode'},
        lualine_b = {'branch'},
        lualine_c = {
            {
                'filename',
                file_status = true,
                path = 2
            }
        },
        lualine_x = {
            {
                'diagnostics',
                sources = {"coc"},
                sections = {'error', 'warn', 'info', 'hint'},   
                colored = true,
                symbols = {error = ' ', warn = ' ', info = ' ', hint = ''},
            },
            'encoding', 'filetype'
        },
        lualine_y = {'progress'},
        lualine_z = {'location'},
    }
}
EOF
Config

Aditional information

shadmansaleh commented 2 years ago

By default diagnostics component looks for DiagnostcWarn, LspDiagnosticsDefaultWarning, DiffText highlight groups in said order https://github.com/nvim-lualine/lualine.nvim/blob/1ae4f0aa74f0b34222c5ef3281b34602a76b2b00/lua/lualine/components/diagnostics/config.lua#L34

Your colotscheme probably doesn't define those groups properly.

You can check colors of those hl_groups to verify:

:hi DiagnostcWarn
:hi LspDiagnosticsDefaultWarning
:hi DiffText

You can overwrite the default colors easily with diagnostics_color option


require'lualine'.setup {
       lualine_x = {
            {
                'diagnostics',
                sources = {"coc"},
                sections = {'error', 'warn', 'info', 'hint'},   
                colored = true,
                symbols = {error = ' ', warn = ' ', info = ' ', hint = ''},
                                diagnostics_color = {
                                       warn = { fg = '#ffa500'},
                                }
            },
            'encoding', 'filetype'
        }
}
mt1ger commented 2 years ago

Sorry for the late reply, thank you.

shadmansaleh commented 2 years ago

Welcome.