lazy.nvim
lazy.nvim copied to clipboard
bug: default colorscheme is overriden by Lazy
Did you check docs and existing issues?
- [X] I have read all the lazy.nvim docs
- [X] I have searched the existing issues of lazy.nvim
- [X] 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
- Don't use a colorscheme
- Add a new plugin
- Restart Neovim
Expected Behavior
- 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",
})
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
inmain.c
Even explicly calling colorscheme default
doesn't work as long as init_highlight
wasn't called.
Maybe load the Lazy installation UI after VimEnter
? Would that be an option?
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.
I encountered the same (or similar) issue. When the bug occurs, the colorscheme is incorrectly set to habamax
.
Closing since this is an upstream issue