Mofiqul / vscode.nvim

Neovim/Vim color scheme inspired by Dark+ and Light+ theme in Visual Studio Code
MIT License
712 stars 114 forks source link

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

Open AlexSWall opened 2 years ago

AlexSWall commented 2 years ago

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...

CyberMango commented 2 years ago

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.