fix(ai): codeium not available after auth (#6926)

- Change event from InsertEnter to BufReadPost to load plugin when opening files
  This ensures Codeium is initialized before statusline rendering and provides
  completions immediately when editing a file.

- Improve lualine status component to check if codeium is loaded
  Previously used cmp_source which depends on cmp being loaded and registered.
  Now checks if the codeium module is available, providing better feedback.

Fixes issue where codeium showed no status on statusline and no completions
after successful authentication.
This commit is contained in:
Your Name 2026-03-16 00:45:31 -07:00
parent 31caef21fd
commit 4127960928

View file

@ -4,7 +4,7 @@ return {
{
"Exafunction/codeium.nvim",
cmd = "Codeium",
event = "InsertEnter",
event = "BufReadPost",
build = ":Codeium Auth",
opts = {
enable_cmp_source = vim.g.ai_cmp,
@ -52,7 +52,13 @@ return {
optional = true,
event = "VeryLazy",
opts = function(_, opts)
table.insert(opts.sections.lualine_x, 2, LazyVim.lualine.cmp_source("codeium"))
table.insert(opts.sections.lualine_x, 2, LazyVim.lualine.status(LazyVim.config.icons.kinds.Codeium, function()
local codeium_enabled = package.loaded["codeium"] ~= nil
if not codeium_enabled then
return
end
return "ok"
end))
end,
},