Closed sharpenedblade closed 1 year ago
this is not reproducible. clone alpha and try again with one of the debug configs https://github.com/goolord/alpha-nvim/blob/main/debug/DEBUG.md and if it works then it's a problem with your config
I think its related to Lazy.nvim
lazy-loading stuff, because once I clone as a native neovim package, it starts working.
So after some debugging, I realized this is caused by a certain colorscheme plugin, namely Catppuccin. I opened a bug against the colorscheme plugins repo, but I think it also belongs here. The colorscheme does not make any changes to alpha-nvim highlights or config, which is why I reopened this bug.
-- `minimal.lua` used for reproducible configuration
-- Open with `nvim --clean -u minimal.lua`
local is_windows = vim.fn.has("win32") == 1
local function join(...)
local sep = is_windows and "\\" or "/"
return table.concat({ ... }, sep)
end
local root_tmp = is_windows and os.getenv("TEMP") or "/tmp"
local lazypath = join(root_tmp, "nvim", "lazy")
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable",
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
{ "catppuccin/nvim", name = "catppuccin" },
-- ADD PLUGINS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
{ "goolord/alpha-nvim" }
})
require("catppuccin").setup({
flavour = "mocha"
})
-- ADD INIT.LUA SETTINGS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
local alpha_config = {
layout = {},
opts = {}
}
require("alpha").setup(alpha_config)
vim.api.nvim_create_autocmd("User", {
pattern = "AlphaReady",
callback = function()
print("AlphaReady called")
end,
})
-- COMMENT this to make the autocmd work
vim.cmd.colorscheme('catppuccin')
if this is some weird interaction with lazy loading i don't consider this a bug with the plugin, fwiw i alos use lazy and i haven't encountered this.
what happens if you add event = "VimEnter",
or lazy = false
to alpha's pluginspec? i would guess that the magic sauce to make everything work right, (i can check tomorrow if you don't have time)
if this is some weird interaction with lazy loading i don't consider this a bug with the plugin, fwiw i alos use lazy and i haven't encountered this.
what happens if you add
event = "VimEnter",
orlazy = false
to alpha's pluginspec? i would guess that the magic sauce to make everything work right, (i can check tomorrow if you don't have time)
It isn't affected by lazy loading, it has something to do with the colorscheme plugin (see the new config I posted). The config just uses lazy to bootstrap itself, it happens with packer to.
EDIT: I just checked, my main config doesn't lazy-load alpha either.
https://github.com/catppuccin/nvim/issues/399#issuecomment-1421838557
what revision of neovim are you using? if it's some old, non-release commit maybe you could try updating to HEAD neovim
The latest brew version, 0.8.3
. A system lib might be broken, I will try in a fresh VM. EDIT: luajit
was broken, it was causing weird problems, a reinstall fixed this.
Description
Any autocmds for
User
with the patternAlphaReady
are not run when entering an alpha buffer. Thenoautcmds
option is not set.Expected Behavior
Autocmds created for
AlphaReady
are run when opening alpha.Actual Behavior
The
AlphaReady
autocmd is not run.Reproducible Example
Using vimscript instead of lua to make the autocmd does not affect this bug.