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

bug: default colorscheme is overriden by Lazy #1413

Open
3 tasks done
famiu opened this issue Apr 16, 2024 · 4 comments
Open
3 tasks done

bug: default colorscheme is overriden by Lazy #1413

famiu opened this issue Apr 16, 2024 · 4 comments
Labels

Comments

@famiu
Copy link

famiu commented Apr 16, 2024

Did you check docs and existing issues?

  • I have read all the lazy.nvim docs
  • I have searched the existing issues of lazy.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

NVIM v0.10.0-dev-2914+g4ec8fd43b

Operating system/version

Fedora Linux 39

Describe the bug

When using the default colorscheme, if Lazy installs a new plugin, the default colorscheme is overriden

Steps To Reproduce

  1. Don't use a colorscheme
  2. Add a new plugin
  3. Restart Neovim

Expected Behavior

  1. Lazy.nvim installs the plugins without changing the default colorscheme

Even in the lazy config, if I use install.colorscheme = {} or install.colorscheme = { 'default' }, it still uses the vim colorscheme instead of default, for some reason

Repro

-- DO NOT change the paths and don't remove the colorscheme
-- This comment is N/A for this issue since the colorscheme IS relevant to the issue itself.
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})
@famiu famiu added the bug Something isn't working label Apr 16, 2024
@folke
Copy link
Owner

folke commented Apr 22, 2024

Lazy does not override the colorscheme at all when set to default.
I just did some testing and it seems that Neovim's new default colorscheme highlights are loaded right before VimEnter, so the default colors before that are simply incorrect.

Nothing lazy can do about this.

Relevant code is:

  • init_highlight in main.c

Even explicly calling colorscheme default doesn't work as long as init_highlight wasn't called.

@folke folke added upstream and removed bug Something isn't working labels Apr 22, 2024
@famiu
Copy link
Author

famiu commented Apr 22, 2024

Maybe load the Lazy installation UI after VimEnter? Would that be an option?

@folke
Copy link
Owner

folke commented Apr 23, 2024

no, since plugins might depend on VimEnter.
Also, loading any other colorscheme works fine. Builtin or external ones.

It's just the default colorscheme that won't load, so this is really an issue that should be fixed in Neovim.

@vhakulinen
Copy link

I encountered the same (or similar) issue. When the bug occurs, the colorscheme is incorrectly set to habamax.

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

No branches or pull requests

3 participants