Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Inconsistent background colors in lualine and transparent background #421

Open
acarril opened this issue Mar 10, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@acarril
Copy link

acarril commented Mar 10, 2024

Neovim version (nvim -v)

0.95

Operating system/version

MacOS 13.6.4 / Springdale Linux 9.2

Describe the bug

The theme's integration with lualine works well out of the box. Note that the lualine_c component has a background color that is darker than the theme's background:

image

However, when enabling background transparency (i.e. { options = { transparent = true } }), the lualine integration falls back to no background color for the lualine_c component:

image

I am reporting this as a bug as I believe that enabling background transparency should only affect highlight groups that have assigned the background color, and the lualine_c component should remain highlighted with a different color, regardless of background transparency.

However, this behavior seems to occur by design: lua/nightfox/util/lualine.lua defines a background color for this component that is empty if transparency is enabled:

local tbg = config.transparent and "NONE" or s.bg0

normal = {
a = { bg = p.blue.base, fg = s.bg0, gui = "bold" },
b = { bg = fade(p.blue.base), fg = s.fg1 },
c = { bg = tbg, fg = s.fg2 },
},

Steps To Reproduce

  1. Install nightfox and lualine
  2. Set require('nightfox').setup({ { options = { transparent = true } } }) and require('lualine').setup()

Expected Behavior

The lualine_c component should remain highlighted with the same background color that it has when transparency is not enabled:

image

Repro

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
	vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
	vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
	{
		"EdenEast/nightfox.nvim",
		config = function()
			require("nightfox").setup({
				options = { transparent = true }, -- NOTE: toggle to `false` to compare
			})
			vim.cmd.colorscheme("nordfox")
		end,
	},
	-- add any other plugins here
	{
		"nvim-lualine/lualine.nvim",
		dependencies = { "nvim-tree/nvim-web-devicons" },
		config = function()
			require("lualine").setup()
		end,
	},
}
require("lazy").setup(plugins, {
	root = root .. "/plugins",
})
@acarril acarril added the bug Something isn't working label Mar 10, 2024
@acarril acarril changed the title bug: bug: Inconsistent background colors in lualine and transparent background Mar 10, 2024
acarril added a commit to acarril/kickstart.nvim that referenced this issue Mar 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant