-
Notifications
You must be signed in to change notification settings - Fork 452
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: buffers
in tabline
don't render color
appropriately
#1169
Comments
buffers component actually has a slightly different option named tabline = {
lualine_a = {
{
'buffers',
buffers_color = { -- This doesn't work
active = {fg='#ff0000', bg='#0000ff'},
inactive = {fg='#0000ff', bg='#ff0000'}
},
use_mode_colors = false,
},
}, https://github.com/nvim-lualine/lualine.nvim?tab=readme-ov-file#buffers-component-options |
@shadmansaleh Are there ways to make the |
You can set any color options in lualine to a function that returns the desired color value. You can get dynamic color that way |
@shadmansaleh Do I need to trigger some sort of a refresh, so that when the mode changes the colors get reloaded? Any tips or docs on howto go about that? Edit: So there seems to be require('lualine').refresh() But it is not supposed to be called from inside of components. |
It was surprisingly easier that I thought. Here is the code for anyone interessted. buffers_color = {
active = function()
local mode_names = {
n = "lualine_a_normal",
i = "lualine_a_insert",
v = "lualine_a_visual",
V = "lualine_a_visual",
R = "lualine_a_replace",
}
local mode = vim.api.nvim_get_mode().mode
return mode_names[mode]
end,
}, |
No. not necessary. Lualine already refreshes itself on mode change. Even if that wasn't the case you could've always created an autoc-command that calls |
Self Checks
How to reproduce the problem
Expected behaviour
buffers
component of thetabline
reacts tocolor{}
the same way as any other component.Actual behaviour
Odd rendering using theme colours.
Minimal config to reproduce the issue
Additional information
Latest Lazy and
lualine.nvim
, nVim v0.9.4.The text was updated successfully, but these errors were encountered: