mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
fix(navic): Use the same background color as lualine section_c
Prior to this, when using the navic Extra, the symbol breadcrumbs shown in lualine section_c had a background color different from the background of lualine_c, causing it to standout and not blend in with some colorschemes. There were ways around this problem, but hose involved overriding a lot of highlights. See https://github.com/LazyVim/LazyVim/issues/328 This change uses the new (as of April 2023) lualine component built in to SmiteshP/nvim-navic, which has a `color_correction` option to fix the problem described above. This built-in component replaces the manual method of calling `require("nvim-navic").is_available()` and `require("nvim-navic").get_location()`. *711e9f117a*bf587250f8With `color_correction` set to "static" or "dynamic", navic uses the lualine section's background color when building the breadcrumbs text. I chose to set color_correction to "dynamic" to provide the best user experience as that will update the background any time the lualine section's background changes (e.g. when switching modes).
This commit is contained in:
parent
a1c3ec4cd4
commit
23c50bb4b0
1 changed files with 1 additions and 8 deletions
|
|
@ -30,14 +30,7 @@ return {
|
||||||
optional = true,
|
optional = true,
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
if not vim.g.trouble_lualine then
|
if not vim.g.trouble_lualine then
|
||||||
table.insert(opts.sections.lualine_c, {
|
table.insert(opts.sections.lualine_c, { "navic", color_correction = "dynamic" })
|
||||||
function()
|
|
||||||
return require("nvim-navic").get_location()
|
|
||||||
end,
|
|
||||||
cond = function()
|
|
||||||
return package.loaded["nvim-navic"] and require("nvim-navic").is_available()
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue