vscode.nvim icon indicating copy to clipboard operation
vscode.nvim copied to clipboard

[Bug] Lualine does not respect transparency

Open bojanmilevski opened this issue 3 years ago • 2 comments

My vscode.nvim lua configuration:

require('vscode').setup {
    transparent = true,
}

My lualine configuration:

require('lualine').setup {
    options = {
        theme = 'vscode'
    }
}

With this configuration, one would expect that lualine's colors.bg variable would be transparent - but that is not the case.

Setting colors.bg = '#00000000' in vscode.nvim/lua/lualine/themes/vscode.lua (in my nvim data directory) successfully opaques lualine's background, but it would be nice for this "feature" to be added in this repository.

I am not very familiar with the source code of vscode.nvim nor lualine, but with a little bit of guidance, I would be happy to implement this feature and test it, before submitting a pull request.

Before I do so, how would it be possible to check if vscode.nvim's transparency setting is set to true in vscode.nvim/lua/lualine/themes/vscode.lua? I have noticed that there is a vim.g.vscode_transparent option in vscode.nvim/lua/vscode/init.lua, but further guidance is needed.

Looking forward on collaborating and contributing!

bojanmilevski avatar Sep 20 '22 18:09 bojanmilevski

checking if vim.g.vscode_transparent is set to true or not and override colors.bg will be sufficient around somewhere after line 26

Mofiqul avatar Sep 21 '22 17:09 Mofiqul

vscode.nvim/lua/lualine/themes/vscode.lua, lines 6-13

if vim.o.background == 'dark' then
    if vim.g.vscode_transparent then
        colors.bg = '#00000000'
    else
        colors.bg = '#262626'
    end

    colors.bg2 = '#373737'
...

After testing this code, it appears that vim.g.vscode_transparent is always false. Trying :lua print(vim.g.vscode_transparent) prints out nil. How can I access the user_opts in vscode.nvim/lua/lualine/themes/vscode.lua from vscode.nvim/lua/vscode/init.vim? I tried:

local settings = require('vscode.init')

but I can't figure out how to access the transparent variable.

Further help is needed.

bojanmilevski avatar Sep 21 '22 18:09 bojanmilevski