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

The 'light' background can't work when setting colorscheme to the 'visual_studio_code' #8

Open
alexya opened this issue Apr 28, 2024 · 2 comments

Comments

@alexya
Copy link

alexya commented Apr 28, 2024

I like the Visual Studio Code default color scheme Light+ very much and found that you are creating a color scheme including light and dark like Visual Studio Code for Neovim. Thank you very much.

macOS: Sonoma 14.4.1
iterm2: Build 3.4.23
NVIM v0.9.5

My config is here: https://github.com/alexya/josean-dev-env/tree/main/.config/nvim

I set to use the <leader>bg to switch background, and <leader>co to change the colorscheme. (The leader is space key)
Please watch the repro video, when changing from the modus colorscheme to tokyonight, it worked fine. But next when I tried to switch to visual_studio_code, it failed. And changed the background to 'dark' automatically. Even if I forced to set it to 'light', it still shows as 'dark' with incorrect color. All the other colorscheme can work fine under 'light' and 'dark'.

I tried to rm -rf ~/.local/share/nvim and opened Neovim again. The problem still existed.

I don't know why. I am not good at debugging Neovim and its plugins. Any help will be much appreciated.
thx.

repro video
neovim-vscode-theme-issue.mp4
@askfiy
Copy link
Owner

askfiy commented May 6, 2024

Predictably, the theme uses the dark color scheme by default.

When you use the colorscheme command to modify the color scheme, essentially it runs colors/visual_studio_code.vim file.

The workaround is that you need to manually call setup and set mode to light, but not use the vim.cmd([[colorscheme visual_studio_code]]) command.

It should take effect when you manually call the [[colorscheme visual_studio_code]] command in the command line.

@alexya
Copy link
Author

alexya commented May 20, 2024

The workaround is that you need to manually call setup and set mode to light

Do you mean set like this? https://github.com/alexya/josean-dev-env/blob/main/.config/nvim/lua/josean/plugins/colorscheme.lua#L17
I ever did it, but it still can't work.

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