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

Specifying a group_override dependent on a color_override doesn't work #77

Open
AlexSWall opened this issue Jul 18, 2022 · 1 comment
Open

Comments

@AlexSWall
Copy link

AlexSWall commented Jul 18, 2022

For example,

local c = require('vscode.colors')
require('vscode').setup({
    color_overrides = {
        vscGray = '#ff0000'
    },
    group_overrides = {
        StatusLine = { fg = c.vscGray, bg = c.vscGray }
    }
}

This will display the status line as grey, not red.

This makes sense as we're accessing the old version of c.vscGray in the group_overrides table, but also it seems sensible to provide a way to add group overrides after adding colour overrides, to avoid this issue.

P.S. I really appreciate this new setup system! Very pleased to be moving my modifications over to the setup function over manually hacking at the files and hackily symlinking my new versions into the cloned repo...

@TheResplandor
Copy link

In my opinion this should stay the behavior. When you pass StatusLine and use values from c, the var c still hasnt changed, so essentially you are passing StatusLine = { fg = '#222222', bg = '#222222' } (assuming vscGrey is '#222222').

Supporting something like this would mean that the user would need to pass something like StatusLine = { fg = 'vscGray', bg = 'vscGray' } (strings of color name instead of RGB values). the function would then need to detect if the value is a color name or RGB value and act accordingly.
I find this unintuitive and i personally dont like it when values can mean 2 different things. Adding a second API for this is also meh.

Though im not related to this project so I dont get to decide. just sharing my opinion.

If i were you i would either call the function twice - once for individual values and once for the group values, or just make a local var for every such color.

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

No branches or pull requests

2 participants