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

Fix overrides not resetting fg or bg #369

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

eeeXun
Copy link
Contributor

@eeeXun eeeXun commented Nov 25, 2024

The problem is when the group already has its own fg and bg, like DiffText. I want to override the bg color (see #314) but still retain the fg color, which is the syntax color provided by treesitter or LSP.

require("gruvbox").setup({
    overrides = {
        DiffText = {bg = "#6f5a2b"}
    }
})
vim.cmd("colorscheme gruvbox")

The
DiffText has the fg color bg0 and overrides doesn't clear fg color for me. So I can't get the syntax color provided by treesitter and LSP.

The problem is when the group already has its own fg and bg, like
DiffText. I want to override the bg color (see ellisonleao#314) but still retain
the fg color, which is the syntax color provided by treesitter or LSP.

```lua
require("gruvbox").setup({
    overrides = {
        DiffText = {bg = "#6f5a2b"}
    }
})
vim.cmd("colorscheme gruvbox")
```

The
[DiffText](https://github.com/ellisonleao/gruvbox.nvim/blob/main/lua/gruvbox.lua#L366)
has the fg color `bg0` and overrides doesn't clear fg color for me. So
I can't get the syntax color provided by treesitter and LSP.
@ljden
Copy link

ljden commented Jan 20, 2025

I don't think this is the right way to get the behaviour you're after - this clears the existing config, which means you are overriding more than just the bg

For example, the Todo group has the following config:

:highlight Todo
Todo           xxx cterm=bold,italic gui=bold,italic guifg=#282828 guibg=#fabd2f  

If I apply the following override:

overrides = {
  Todo = { bg = '#FFFFFF' },
}

I would expect the bg colour is set to white, and no other configs are changed.

The current behaviour is exactly this:

:highlight Todo                                                                                                                                                                                                                                                                                                                                                              
Todo           xxx cterm=bold,italic gui=bold,italic guifg=#282828 guibg=#ffffff   

Whereas this PR behaviour is:

:highlight Todo                                                                                                                                                                                                                                                                                                                                                             
Todo           xxx guibg=#ffffff   

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants