Closed greeid closed 21 hours ago
Update :
I tried using neovim's inherent colors like :
-- Some other code
lualine_b = {
{ 'fancy_branch' },
{
'fancy_diff',
colored = true,
diff_color = {
added = 'green',
modified = 'yellow',
removed = 'red',
},
},
}
-- some other code
This didn't throw an error but also shows white text for add, rem and modified
Hi, thanks for reporting this. I will take a look over the week end and let you know.
From reading the Lualine docs, I think the problem is that when you pass a string to added
, removed
or modified
, it expects a highlight (as defined by your color scheme). If you want to pass in custom RGB color, you need to provide a lua table with fg
(and optionally bg
defined). So for instance, with this:
{
'fancy_diff',
diff_color = {
-- Same color values as the general color option can be used here.
added = { fg = '#98c379', bg = "red" },
modified = { fg = '#7199ee', bg = "green" },
removed = { fg = '#ee6d85', bg = "blue" },
},
}
you get what you wanted (I added the background color for emphasis):
I have to say the lualine docs are not super explicit about this 😅
I'll close this one as I think your problem is solved. Feel free to re-open if you encounter any problems or have any questions.
Minimal Config
I get the error :
I tried editing according to this snippet :
from here