folke / trouble.nvim

🚦 A pretty diagnostics, references, telescope results, quickfix and location list to help you solve all the trouble your code is causing.
Apache License 2.0
5.44k stars 176 forks source link

bug: Incorrect Lualine Highlight #569

Open Isrothy opened 1 month ago

Isrothy commented 1 month ago

Did you check docs and existing issues?

Neovim version (nvim -v)

0.10.1

Operating system/version

MacOS 14.6.1

Describe the bug

The symbols and separators in Lualine have inconsistent highlights.

QQ_1724208361558

Steps To Reproduce

  1. Use a color scheme, for example, "gbprod/nord.nvim"
return {
    "gbprod/nord.nvim",
    priority = 100,
    lazy = false,
    config = function()
        vim.cmd.colorscheme("nord")
    end,

}
  1. Insert trouble statusline component into into winbar.

Lualine configuration like this:

{
    "nvim-lualine/lualine.nvim",
    lazy = false,
    dependencies = {
        "nvim-tree/nvim-web-devicons",
    },

    config = function()
        local c = require("nord.colors").palette

        local trouble = require("trouble")
        local symbols = trouble.statusline({
            mode = "lsp_document_symbols",
            groups = {},
            title = false,
            filter = { range = true },
            format = "{kind_icon}{symbol.name:Normal}",
            -- The following line is needed to fix the background color
            -- Set it to the lualine section you want to use
            hl_group = "lualine_c_normal",
        })

        require("lualine").setup({
            winbar = {
                lualine_c = {
                    {
                        symbols.get,
                        cond = symbols.has,
                    },
                },
            },
        })
    end,
},

Expected Behavior

The symbols and separators in Lualine have should have the same background.

Repro

vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()

require("lazy.minit").repro({
    spec = {
        {
            "folke/trouble.nvim",
        },
        {
            "neovim/nvim-lspconfig",
            lazy = false,
            config = function()
                require("lspconfig").lua_ls.setup({})
            end,
        },

        -- add any other plugins here
        {
            "gbprod/nord.nvim",
            priority = 100,
            lazy = false,
            config = function()
                vim.cmd.colorscheme("nord")
            end,
        },
        {
            "nvim-lualine/lualine.nvim",
            lazy = false,
            dependencies = {
                "nvim-tree/nvim-web-devicons",
            },

            config = function()
                local c = require("nord.colors").palette

                local trouble = require("trouble")
                local symbols = trouble.statusline({
                    mode = "lsp_document_symbols",
                    groups = {},
                    title = false,
                    filter = { range = true },
                    format = "{kind_icon}{symbol.name:Normal}",
                    -- The following line is needed to fix the background color
                    -- Set it to the lualine section you want to use
                    hl_group = "lualine_c_normal",
                })

                require("lualine").setup({
                    winbar = {
                        lualine_c = {
                            {
                                symbols.get,
                                cond = symbols.has,
                            },
                        },
                    },
                })
            end,
        },
    },
})
github-actions[bot] commented 1 week ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

qeisar commented 1 week ago

Same issue with various color schemes: tokyonight, catppucin, kanagawa.