SmiteshP / nvim-navic

Simple winbar/statusline plugin that shows your current code context
Apache License 2.0
1.35k stars 49 forks source link

Lualine highlight glitch #123

Closed karma-riuk closed 1 year ago

karma-riuk commented 1 year ago

After wanting to add highlighting to navic on lualine and following the README.md, a small glitch can be seen (c.f. image below)

image

As you can see, the last character of the navic component has transparent background.

My config for lualine and navic is the following

winbar = {
    lualine_c = {
        {
            "navic",
            color_correction = "static",
            navic_opts = { highlight = true },
        },
    },
    lualine_z = { "filename" },
},

(I don't think the rest is relevant, but I can show it if you feel like you need it)

I tried with a variety of files, languages and lsp servers, as well as setting highlight = true when I setup navic as opposed to using navic_opts, they all give me the same little glitch.

I don't know whether it is a navic problem or a lualine problem, but I have other components (such as the number of lsp warnings / errors present in the file) and they do not have that issue.

karma-riuk commented 1 year ago

I'm so sorry, I'm blind... I thought I read the previous issues before posting, but right after posting I saw #115 is stating exactly the same issue.

The fix is the same as in that issue: removing the right padding to remove the invisible character:

lualine_c = {
    {
        "navic",
        color_correction = "static",
        navic_opts = { highlight = true },
        padding = {
            left = 1,
            right = 0,
        },
    },
},

Note the left = 1. For some reason if I only put padding = { right = 0 }, then both left and right would be set to zero. This was the left padding is as it was before.